diff options
author | Igor Babaev <igor@askmonty.org> | 2018-08-17 14:27:42 -0700 |
---|---|---|
committer | Igor Babaev <igor@askmonty.org> | 2018-08-17 14:28:39 -0700 |
commit | 4eac5df3fcebb1adf52e33d9d88dc05bc1e339ce (patch) | |
tree | 9920b683a5ac5928d271b9e679e74c7937924922 /sql/sql_class.h | |
parent | d6f7fd601637a070ccf922073c0ef9a41a129717 (diff) | |
download | mariadb-git-4eac5df3fcebb1adf52e33d9d88dc05bc1e339ce.tar.gz |
MDEV-16934 Query with very large IN clause lists runs slowly
This patch introduces support for the system variable eq_range_index_dive_limit
that existed in MySQL starting from 5.6. The variable sets a limit for
index dives into equality ranges. Index dives are performed by optimizer
to estimate the number of rows in range scans. Index dives usually provide
good estimate but they are pretty expensive. To estimate the number of rows
in equality ranges statistical data on indexes can be employed. Its usage gives
not so good estimates but it's cheap. So if the number of equality dives
required by an index scan exceeds the set limit no dives for equality
ranges are performed by the optimizer for this index.
As the new system variable is introduced in a stable version the default
value for it is set to a special value meaning there is no limit for the number
of index dives performed by the optimizer.
The patch partially uses the MySQL code for WL 5957
'Statistics-based Range optimization for many ranges'.
Diffstat (limited to 'sql/sql_class.h')
-rw-r--r-- | sql/sql_class.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_class.h b/sql/sql_class.h index cb7523af615..4888b38bc30 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -569,6 +569,7 @@ typedef struct system_variables ha_rows max_join_size; ha_rows expensive_subquery_limit; ulong auto_increment_increment, auto_increment_offset; + uint eq_range_index_dive_limit; ulong lock_wait_timeout; ulong join_cache_level; ulong max_allowed_packet; |