mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +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:
@ -3156,6 +3156,11 @@ public:
|
||||
DBUG_ASSERT(m_lock_type == F_UNLCK);
|
||||
DBUG_ASSERT(inited == NONE);
|
||||
}
|
||||
/* To check if table has been properely opened */
|
||||
bool is_open()
|
||||
{
|
||||
return ref != 0;
|
||||
}
|
||||
virtual handler *clone(const char *name, MEM_ROOT *mem_root);
|
||||
/** This is called after create to allow us to set up cached variables */
|
||||
void init()
|
||||
@ -4804,6 +4809,7 @@ public:
|
||||
ha_share= arg_ha_share;
|
||||
return false;
|
||||
}
|
||||
void set_table(TABLE* table_arg) { table= table_arg; }
|
||||
int get_lock_type() const { return m_lock_type; }
|
||||
public:
|
||||
/* XXX to be removed, see ha_partition::partition_ht() */
|
||||
|
Reference in New Issue
Block a user