1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

MDEV-34993: fix merge into 10.6: OPTIMIZER_ADJ_FIX_CARD_MULT should be ON by default

This commit is contained in:
Sergei Petrunia
2024-10-15 17:35:27 +03:00
parent a4d2cc931d
commit 89493a9980
6 changed files with 19 additions and 13 deletions

View File

@ -1709,7 +1709,7 @@ old-alter-table DEFAULT
old-mode UTF8_IS_UTF8MB3
old-passwords FALSE
old-style-user-limits FALSE
optimizer-adjust-secondary-key-costs fix_reuse_range_for_ref
optimizer-adjust-secondary-key-costs fix_reuse_range_for_ref,fix_card_multiplier
optimizer-join-limit-pref-ratio 0
optimizer-max-sel-arg-weight 32000
optimizer-max-sel-args 16000

View File

@ -82,7 +82,7 @@ json_detailed(json_extract(@trace, '$**.considered_access_paths'))
drop table t1, name, flag2;
select @@optimizer_adjust_secondary_key_costs;
@@optimizer_adjust_secondary_key_costs
fix_reuse_range_for_ref
fix_reuse_range_for_ref,fix_card_multiplier
set @@optimizer_adjust_secondary_key_costs=7;
select @@optimizer_adjust_secondary_key_costs;
@@optimizer_adjust_secondary_key_costs

View File

@ -250,7 +250,9 @@ JS
{
"index_name": "key1",
"selectivity_from_index": 0.399,
"selectivity_multiplier": 90.9091
"selectivity_multiplier": 90.9091,
"note": "multiplier too high, clipping",
"clipped_multiplier": 2.506265664
}
]
]
@ -266,16 +268,16 @@ JS
[
{
"access_type": "range",
"resulting_rows": 181.3636545,
"cost": 1.79769e308,
"resulting_rows": 5,
"cost": 6.83879845,
"chosen": true
}
],
"chosen_access_method":
{
"type": "range",
"records": 181.3636545,
"cost": 1.79769e308,
"records": 5,
"cost": 6.83879845,
"uses_join_buffering": false
}
}

View File

@ -245,7 +245,9 @@ JS
{
"index_name": "key1",
"selectivity_from_index": 0.391,
"selectivity_multiplier": 90.9091
"selectivity_multiplier": 90.9091,
"note": "multiplier too high, clipping",
"clipped_multiplier": 2.557544757
}
]
]
@ -261,16 +263,16 @@ JS
[
{
"access_type": "range",
"resulting_rows": 177.7272905,
"cost": 1.79769e308,
"resulting_rows": 5,
"cost": 6.647684891,
"chosen": true
}
],
"chosen_access_method":
{
"type": "range",
"records": 177.7272905,
"cost": 1.79769e308,
"records": 5,
"cost": 6.647684891,
"uses_join_buffering": false
}
}

View File

@ -278,6 +278,8 @@
#define OPTIMIZER_ADJ_FIX_REUSE_RANGE_FOR_REF (16)
#define OPTIMIZER_ADJ_FIX_CARD_MULT (32)
#define OPTIMIZER_ADJ_DEFAULT (OPTIMIZER_ADJ_FIX_REUSE_RANGE_FOR_REF | \
OPTIMIZER_ADJ_FIX_CARD_MULT)
/*
Replication uses 8 bytes to store SQL_MODE in the binary log. The day you
use strictly more than 64 bits by adding one more define above, you should

View File

@ -2860,7 +2860,7 @@ static Sys_var_set Sys_optimizer_adjust_secondary_key_costs(
"This variable will be deleted in MariaDB 11.0 as it is not needed with the "
"new 11.0 optimizer.",
SESSION_VAR(optimizer_adjust_secondary_key_costs), CMD_LINE(REQUIRED_ARG),
adjust_secondary_key_cost, DEFAULT(OPTIMIZER_ADJ_FIX_REUSE_RANGE_FOR_REF));
adjust_secondary_key_cost, DEFAULT(OPTIMIZER_ADJ_DEFAULT));
static Sys_var_charptr_fscs Sys_pid_file(