mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
MDEV-8989: ORDER BY optimizer ignores equality propagation
Variant #4 of the fix. Make ORDER BY optimization functions take into account multiple equalities. This is done in several places: - remove_const() checks whether we can sort the first table in the join, or we need to put rows into temp.table and then sort. - test_if_order_by_key() checks whether there are indexes that can be used to produce the required ordering - make_unireg_sortorder() constructs sort criteria for filesort.
This commit is contained in:
@ -499,7 +499,7 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds,
|
||||
Filesort_tracker *fs_tracker=
|
||||
thd->lex->explain->get_upd_del_plan()->filesort_tracker;
|
||||
|
||||
if (!(sortorder= make_unireg_sortorder(thd, order, &length, NULL)) ||
|
||||
if (!(sortorder= make_unireg_sortorder(thd, NULL, 0, order, &length, NULL)) ||
|
||||
(table->sort.found_records= filesort(thd, table, sortorder, length,
|
||||
select, HA_POS_ERROR,
|
||||
true,
|
||||
|
Reference in New Issue
Block a user