mirror of
https://github.com/MariaDB/server.git
synced 2026-05-16 11:57:38 +02:00
MDEV-16188 Use in-memory PK filters built from range index scans
This patch contains a full implementation of the optimization
that allows to use in-memory rowid / primary filters built for range
conditions over indexes. In many cases usage of such filters reduce
the number of disk seeks spent for fetching table rows.
In this implementation the choice of what possible filter to be applied
(if any) is made purely on cost-based considerations.
This implementation re-achitectured the partial implementation of
the feature pushed by Galina Shalygina in the commit
8d5a11122c.
Besides this patch contains a better implementation of the generic
handler function handler::multi_range_read_info_const() that
takes into account gaps between ranges when calculating the cost of
range index scans. It also contains some corrections of the
implementation of the handler function records_in_range() for MyISAM.
This patch supports the feature for InnoDB and MyISAM.
This commit is contained in:
parent
5f46670bd0
commit
658128af43
190 changed files with 5644 additions and 1976 deletions
|
|
@ -6,6 +6,13 @@
|
|||
|
||||
--source include/have_innodb.inc
|
||||
|
||||
set @innodb_stats_persistent_save= @@innodb_stats_persistent;
|
||||
set @innodb_stats_persistent_sample_pages_save=
|
||||
@@innodb_stats_persistent_sample_pages;
|
||||
|
||||
set global innodb_stats_persistent= 1;
|
||||
set global innodb_stats_persistent_sample_pages=100;
|
||||
|
||||
--disable_warnings
|
||||
drop view if exists v1;
|
||||
drop table if exists t1,t4;
|
||||
|
|
@ -243,3 +250,8 @@ CREATE TABLE t2 (`voter_id` int(10) unsigned NOT NULL DEFAULT '0',
|
|||
insert into t2 values (1,repeat("a",1000)),(2,repeat("a",1000)),(3,repeat("b",1000)),(4,repeat("c",1000)),(4,repeat("b",1000));
|
||||
SELECT GROUP_CONCAT(t1.language_id SEPARATOR ',') AS `translation_resources`, `d`.`serialized_c` FROM t2 AS `d` LEFT JOIN t1 ON `d`.`voter_id` = t1.`voter_id` GROUP BY `d`.`voter_id` ORDER BY 10-d.voter_id+RAND()*0;
|
||||
drop table t1,t2;
|
||||
|
||||
set global innodb_stats_persistent= @innodb_stats_persistent_save;
|
||||
set global innodb_stats_persistent_sample_pages=
|
||||
@innodb_stats_persistent_sample_pages_save;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue