diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2021-01-28 21:43:55 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2021-01-29 16:20:57 +0300 |
commit | c36720388d598ca3aa1c4d2dab2266656c528b50 (patch) | |
tree | 66698613fde2bca7ed26d6af4368579700ebfccc /sql/sys_vars.cc | |
parent | a2eb974b50f1a2912717d765bbd48aa69cfcc8f1 (diff) | |
download | mariadb-git-c36720388d598ca3aa1c4d2dab2266656c528b50.tar.gz |
MDEV-9750: Quick memory exhaustion with 'extended_keys=on' ...
(Variant #5, full patch, for 10.5)
Do not produce SEL_ARG graphs that would yield huge numbers of ranges.
Introduce a concept of SEL_ARG graph's "weight". If we are about to
produce a graph whose "weight" exceeds the limit, remove the parts
of SEL_ARG graph that represent the biggest key parts. Do so until
the graph's is within the limit.
Includes
- debug code to verify SEL_ARG graph weight
- A user-visible @@optimizer_max_sel_arg_weight to control the optimization
- Logging the optimization into the optimizer trace.
Diffstat (limited to 'sql/sys_vars.cc')
-rw-r--r-- | sql/sys_vars.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index 12b6ea96182..f56bd5d8875 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -6693,6 +6693,12 @@ static Sys_var_uint Sys_in_subquery_conversion_threshold( SESSION_VAR(in_subquery_conversion_threshold), CMD_LINE(REQUIRED_ARG), VALID_RANGE(0, UINT_MAX), DEFAULT(IN_SUBQUERY_CONVERSION_THRESHOLD), BLOCK_SIZE(1)); +static Sys_var_ulong Sys_optimizer_max_sel_arg_weight( + "optimizer_max_sel_arg_weight", + "The maximum weight of the SEL_ARG graph. Set to 0 for no limit", + SESSION_VAR(optimizer_max_sel_arg_weight), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(SEL_ARG::MAX_WEIGHT), BLOCK_SIZE(1)); + static Sys_var_enum Sys_secure_timestamp( "secure_timestamp", "Restricts direct setting of a session " "timestamp. Possible levels are: YES - timestamp cannot deviate from " |