1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +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:
Sergei Petrunia
2024-09-24 10:23:34 +03:00
parent 8166a5d33d
commit 1cda4726ca
9 changed files with 175 additions and 1 deletions

View File

@ -257,7 +257,25 @@ select
from
information_schema.optimizer_trace;
--echo # Disable the fix and try the same:
set @@optimizer_adjust_secondary_key_costs='';
explain select * from t1
where
pk in (1,2,3,4,5) and
key1 <= 4;
drop table t1;
--echo # Shows a high multiplier, without a "note":
select
json_detailed(json_extract(trace,'$**.selectivity_for_indexes')) as JS
from
information_schema.optimizer_trace;
--echo # Includes 1.79...e308 as cost:
select
json_detailed(json_extract(trace,'$**.best_access_path')) as JS
from
information_schema.optimizer_trace;
set optimizer_adjust_secondary_key_costs=default;
--echo #
--echo # Clean up