mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-34993, part2: backport optimizer_adjust_secondary_key_costs
...and make the fix for MDEV-34993 switchable. It is enabled by default and controlled with @optimizer_adjust_secondary_key_costs=fix_card_multiplier
This commit is contained in:
@@ -3521,7 +3521,9 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond)
|
||||
multiplied by quick_cond_selectivity above, so we will only
|
||||
multiply it with selectivity_mult).
|
||||
*/
|
||||
if (selectivity_mult > 1.0 / quick_cond_selectivity)
|
||||
if ((thd->variables.optimizer_adjust_secondary_key_costs &
|
||||
OPTIMIZER_ADJ_FIX_CARD_MULT) &&
|
||||
selectivity_mult > 1.0 / quick_cond_selectivity)
|
||||
{
|
||||
selectivity_for_index.add("note", "multiplier too high, clipping");
|
||||
selectivity_mult= 1.0/quick_cond_selectivity;
|
||||
|
Reference in New Issue
Block a user