Skip to content
Permalink
Browse files

Post-merge fixes: rocksdb.bloomfilter3, use_direct_io_for_flush_and_c…

…ompaction
  • Loading branch information...
spetrunia committed Jun 16, 2019
1 parent 23b967d commit c399405885c3545832437071c8067f188365c36c
@@ -20,16 +20,31 @@ id1 id2 link_type visibility data time version
select case when variable_value-@c > 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
case when variable_value-@c > 0 then 'true' else 'false' end
true
# MariaDB: we don't have optimizer_force_index_for_range, but we can use EITS
# to get the query plan we want.
set @tmp_use_stat_tables= @@use_stat_tables;
set use_stat_tables='preferably';
analyze table linktable persistent for all;
Table Op Msg_type Msg_text
test.linktable analyze status Engine-independent statistics collected
test.linktable analyze status OK
flush tables;
explain select * from linktable;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE linktable ALL NULL NULL NULL NULL 10000
# This must use range(id1_type2), key_len=24
explain
select id1, id2, link_type, visibility, data, time, version from linktable
FORCE INDEX(`id1_type2`) where id1 = 100 and link_type = 1 and time >= 0 and time <= 9223372036854775807 order by time desc;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE linktable range id1_type2 id1_type2 24 NULL 1000 Using where; Using index
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
set @tmp_force_index_for_range=@@optimizer_force_index_for_range;
set optimizer_force_index_for_range=on;
select id1, id2, link_type, visibility, data, time, version from linktable FORCE INDEX(`id1_type2`) where id1 = 100 and link_type = 1 and time >= 0 and time <= 9223372036854775807 order by time desc;
id1 id2 link_type visibility data time version
100 100 1 1 100 100 100
select case when variable_value-@c > 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
case when variable_value-@c > 0 then 'true' else 'false' end
true
set global optimizer_force_index_for_range=@tmp_force_index_for_range;
select variable_value into @c from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
select id1, id2, link_type, visibility, data, time, version from linktable FORCE INDEX(`id1_type3`) where id1 = 100 and time >= 0 and time <= 9223372036854775807 and visibility = 1 order by time desc;
id1 id2 link_type visibility data time version
@@ -3,7 +3,7 @@ CREATE TABLE t1 (pk INT PRIMARY KEY DEFAULT '0', a INT(11), b CHAR(8)) ENGINE=ro
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`pk` int(11) NOT NULL DEFAULT '0',
`pk` int(11) NOT NULL DEFAULT 0,
`a` int(11) DEFAULT NULL,
`b` char(8) DEFAULT NULL,
PRIMARY KEY (`pk`)
@@ -34,6 +34,19 @@ select id1, id2, link_type, visibility, data, time, version from linktable FORCE
select case when variable_value-@c > 0 then 'true' else 'false' end from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';

# BF len 20

--echo # MariaDB: we don't have optimizer_force_index_for_range, but we can use EITS
--echo # to get the query plan we want.
set @tmp_use_stat_tables= @@use_stat_tables;
set use_stat_tables='preferably';
analyze table linktable persistent for all;
flush tables;
explain select * from linktable;
--echo # This must use range(id1_type2), key_len=24
explain
select id1, id2, link_type, visibility, data, time, version from linktable
FORCE INDEX(`id1_type2`) where id1 = 100 and link_type = 1 and time >= 0 and time <= 9223372036854775807 order by time desc;

select variable_value into @c from information_schema.global_status where variable_name='rocksdb_bloom_filter_prefix_checked';
# MariaDB: no support for optimizer_force_index_for_range:
#set @tmp_force_index_for_range=@@optimizer_force_index_for_range;

0 comments on commit c399405

Please sign in to comment.
You can’t perform that action at this time.