mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
WL#3527: Extend IGNORE INDEX so places where index is ignored
can be specified Currently MySQL allows one to specify what indexes to ignore during join optimization. The scope of the current USE/FORCE/IGNORE INDEX statement is only the FROM clause, while all other clauses are not affected. However, in certain cases, the optimizer may incorrectly choose an index for sorting and/or grouping, and produce an inefficient query plan. This task provides the means to specify what indexes are ignored/used for what operation in a more fine-grained manner, thus making it possible to manually force a better plan. We do this by extending the current IGNORE/USE/FORCE INDEX syntax to: IGNORE/USE/FORCE INDEX [FOR {JOIN | ORDER | GROUP BY}] so that: - if no FOR is specified, the index hint will apply everywhere. - if MySQL is started with the compatibility option --old_mode then an index hint without a FOR clause works as in 5.0 (i.e, the index will only be ignored for JOINs, but can still be used to compute ORDER BY). See the WL#3527 for further details.
This commit is contained in:
@ -240,6 +240,11 @@ struct system_variables
|
||||
|
||||
my_bool low_priority_updates;
|
||||
my_bool new_mode;
|
||||
/*
|
||||
compatibility option:
|
||||
- index usage hints (USE INDEX without a FOR clause) behave as in 5.0
|
||||
*/
|
||||
my_bool old_mode;
|
||||
my_bool query_cache_wlock_invalidate;
|
||||
my_bool engine_condition_pushdown;
|
||||
my_bool innodb_table_locks;
|
||||
@ -277,6 +282,7 @@ struct system_variables
|
||||
DATE_TIME_FORMAT *datetime_format;
|
||||
DATE_TIME_FORMAT *time_format;
|
||||
my_bool sysdate_is_now;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user