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

MDEV-28846 Poor performance when rowid filter contains no elements

When a range rowid filter was used with an index ref access the cost of
accessing the index entries for the records rejected by the filter was not
taken into account. For a ref access by an index with big average number
of records per key this led to poor execution plans if selectivity of the
used filter was high.
The patch resolves this problem. It also introduces a minor optimization
that skips look-ups into a filter that turns out to be empty.
With this patch the output of ANALYZE stmt reports the number of look-ups
into used rowid filters.
The patch also back-ports from 10.5 the code that properly sets the field
TABLE::file::table for opened temporary tables.

The test cases that were supposed to use rowid filters have been adjusted
in order to use similar execution plans after this fix.

Approved by Oleksandr Byelkin <sanja@mariadb.com>
This commit is contained in:
Igor Babaev
2022-10-17 16:44:10 -07:00
parent f1bbc1cd19
commit 58cd0bd59e
21 changed files with 1797 additions and 170 deletions

View File

@ -4171,7 +4171,7 @@ void select_insert::abort_result_set()
table will be assigned with view table structure, but that table will
not be opened really (it is dummy to check fields types & Co).
*/
if (table && table->file->get_table())
if (table && table->file->is_open())
{
bool changed, transactional_table;
/*