diff options
author | Monty <monty@mariadb.org> | 2022-10-31 18:02:36 +0200 |
---|---|---|
committer | Sergei Petrunia <sergey@mariadb.com> | 2023-02-02 23:59:44 +0300 |
commit | 66d9c1b22d7274a0df294386e196b198a4d301cf (patch) | |
tree | abc34a6f812d268ed14348facb10832f60fa360a /sql/sql_update.cc | |
parent | 4464aa4628745c98efad6979d55bff2df7801925 (diff) | |
download | mariadb-git-66d9c1b22d7274a0df294386e196b198a4d301cf.tar.gz |
Fixes for 'Filtering'
- table_after_join_selectivity() should use records_init (new bug)
- get_examined_rows() changed to double to get similar results
as in MariaDB 10.11
- Fixed bug where table_after_join_selectivity() did not correct
selectivity in the case where a RANGE is used instead of a REF.
This can happen if the range can use more key_parts than the REF.
WHERE key_part1=10 and key_part2 < 10
Other things:
- Use JT_RANGE instead of JT_ALL for RANGE access in all parts of the code.
Before we used JT_ALL for RANGE.
- Force RANGE be used in best_access_path() if the range used more key
parts than ref. In the original code, this was done much later in
make_join_select)(). However we need to know in
table_after_join_selectivity() if we have used RANGE or not.
- Added more information about filtering to optimizer_trace.
Diffstat (limited to 'sql/sql_update.cc')
-rw-r--r-- | sql/sql_update.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sql/sql_update.cc b/sql/sql_update.cc index 45a7da787ad..5327e1f1095 100644 --- a/sql/sql_update.cc +++ b/sql/sql_update.cc @@ -2271,6 +2271,7 @@ static bool safe_update_on_fly(THD *thd, JOIN_TAB *join_tab, case JT_REF: case JT_REF_OR_NULL: return !is_key_used(table, join_tab->ref.key, table->write_set); + case JT_RANGE: case JT_ALL: if (bitmap_is_overlapping(&table->tmp_set, table->write_set)) return FALSE; |