Commit e44633c8 authored by Sergei Golubchik's avatar Sergei Golubchik

rename "partitioned key cache" to "segmented"

parent 5379038a
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3;
SET @save_key_buffer_size=@@key_buffer_size; SET @save_key_buffer_size=@@key_buffer_size;
SET @save_key_cache_block_size=@@key_cache_block_size; SET @save_key_cache_block_size=@@key_cache_block_size;
SET @save_key_cache_partitions=@@key_cache_partitions; SET @save_key_cache_segments=@@key_cache_segments;
SELECT @@key_buffer_size, @@small.key_buffer_size; SELECT @@key_buffer_size, @@small.key_buffer_size;
@@key_buffer_size @@small.key_buffer_size @@key_buffer_size @@small.key_buffer_size
2097152 131072 2097152 131072
...@@ -376,8 +376,8 @@ select @@key_buffer_size; ...@@ -376,8 +376,8 @@ select @@key_buffer_size;
select @@key_cache_block_size; select @@key_cache_block_size;
@@key_cache_block_size @@key_cache_block_size
1024 1024
select @@key_cache_partitions; select @@key_cache_segments;
@@key_cache_partitions @@key_cache_segments
0 0
create table t1 ( create table t1 (
p int not null auto_increment primary key, p int not null auto_increment primary key,
...@@ -385,11 +385,11 @@ a char(10)); ...@@ -385,11 +385,11 @@ a char(10));
create table t2 ( create table t2 (
p int not null auto_increment primary key, p int not null auto_increment primary key,
i int, a char(10), key k1(i), key k2(a)); i int, a char(10), key k1(i), key k2(a));
select @@key_cache_partitions; select @@key_cache_segments;
@@key_cache_partitions @@key_cache_segments
0 0
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default NULL NULL 2097152 1024 0 # 0 0 0 0 0 default NULL NULL 2097152 1024 0 # 0 0 0 0 0
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
insert into t1 values (1, 'qqqq'), (2, 'yyyy'); insert into t1 values (1, 'qqqq'), (2, 'yyyy');
...@@ -416,27 +416,27 @@ Key_read_requests 22 ...@@ -416,27 +416,27 @@ Key_read_requests 22
Key_reads 0 Key_reads 0
Key_write_requests 26 Key_write_requests 26
Key_writes 6 Key_writes 6
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default NULL NULL 2097152 1024 4 # 0 22 0 26 6 default NULL NULL 2097152 1024 4 # 0 22 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
delete from t2 where a='zzzz'; delete from t2 where a='zzzz';
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default NULL NULL 2097152 1024 4 # 0 29 0 32 9 default NULL NULL 2097152 1024 4 # 0 29 0 32 9
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
delete from t1; delete from t1;
delete from t2; delete from t2;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default NULL NULL 2097152 1024 4 # 0 29 0 32 9 default NULL NULL 2097152 1024 4 # 0 29 0 32 9
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
set global key_cache_partitions=2; set global key_cache_segments=2;
select @@key_cache_partitions; select @@key_cache_segments;
@@key_cache_partitions @@key_cache_segments
2 2
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 2097152 1024 0 # 0 0 0 0 0 default 2 NULL 2097152 1024 0 # 0 0 0 0 0
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
insert into t1 values (1, 'qqqq'), (2, 'yyyy'); insert into t1 values (1, 'qqqq'), (2, 'yyyy');
...@@ -463,22 +463,22 @@ Key_read_requests 22 ...@@ -463,22 +463,22 @@ Key_read_requests 22
Key_reads 0 Key_reads 0
Key_write_requests 26 Key_write_requests 26
Key_writes 6 Key_writes 6
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 2097152 1024 4 # 0 22 0 26 6 default 2 NULL 2097152 1024 4 # 0 22 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
delete from t1; delete from t1;
delete from t2; delete from t2;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 2097152 1024 4 # 0 22 0 26 6 default 2 NULL 2097152 1024 4 # 0 22 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
set global key_cache_partitions=1; set global key_cache_segments=1;
select @@key_cache_partitions; select @@key_cache_segments;
@@key_cache_partitions @@key_cache_segments
1 1
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 1 NULL 2097152 1024 0 # 0 0 0 0 0 default 1 NULL 2097152 1024 0 # 0 0 0 0 0
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
insert into t1 values (1, 'qqqq'), (2, 'yyyy'); insert into t1 values (1, 'qqqq'), (2, 'yyyy');
...@@ -505,32 +505,32 @@ Key_read_requests 22 ...@@ -505,32 +505,32 @@ Key_read_requests 22
Key_reads 0 Key_reads 0
Key_write_requests 26 Key_write_requests 26
Key_writes 6 Key_writes 6
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 1 NULL 2097152 1024 4 # 0 22 0 26 6 default 1 NULL 2097152 1024 4 # 0 22 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
delete from t1; delete from t1;
delete from t2; delete from t2;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 1 NULL 2097152 1024 4 # 0 22 0 26 6 default 1 NULL 2097152 1024 4 # 0 22 0 26 6
small NULL NULL 1048576 1024 1 # 0 1 0 2 1 small NULL NULL 1048576 1024 1 # 0 1 0 2 1
flush tables; flush tables;
flush status; flush status;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 1 NULL 2097152 1024 4 # 0 0 0 0 0 default 1 NULL 2097152 1024 4 # 0 0 0 0 0
small NULL NULL 1048576 1024 1 # 0 0 0 0 0 small NULL NULL 1048576 1024 1 # 0 0 0 0 0
set global key_buffer_size=32*1024; set global key_buffer_size=32*1024;
select @@key_buffer_size; select @@key_buffer_size;
@@key_buffer_size @@key_buffer_size
32768 32768
set global key_cache_partitions=2; set global key_cache_segments=2;
select @@key_cache_partitions; select @@key_cache_segments;
@@key_cache_partitions @@key_cache_segments
2 2
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 0 # 0 0 0 0 0 default 2 NULL 32768 1024 0 # 0 0 0 0 0
small NULL NULL 1048576 1024 1 # 0 0 0 0 0 small NULL NULL 1048576 1024 1 # 0 0 0 0 0
insert into t1 values (1, 'qqqq'), (2, 'yyyy'); insert into t1 values (1, 'qqqq'), (2, 'yyyy');
...@@ -548,8 +548,8 @@ p i a ...@@ -548,8 +548,8 @@ p i a
4 3 zzzz 4 3 zzzz
update t1 set p=3 where p=1; update t1 set p=3 where p=1;
update t2 set i=2 where i=1; update t2 set i=2 where i=1;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 4 # 0 22 0 26 6 default 2 NULL 32768 1024 4 # 0 22 0 26 6
small NULL NULL 1048576 1024 1 # 0 0 0 0 0 small NULL NULL 1048576 1024 1 # 0 0 0 0 0
insert into t1(a) select a from t1; insert into t1(a) select a from t1;
...@@ -568,8 +568,8 @@ insert into t2(i,a) select i,a from t2; ...@@ -568,8 +568,8 @@ insert into t2(i,a) select i,a from t2;
insert into t2(i,a) select i,a from t2; insert into t2(i,a) select i,a from t2;
insert into t2(i,a) select i,a from t2; insert into t2(i,a) select i,a from t2;
insert into t2(i,a) select i,a from t2; insert into t2(i,a) select i,a from t2;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 6733 # 3684 103 default 2 NULL 32768 1024 # # 0 6733 # 3684 103
small NULL NULL 1048576 1024 # # 0 0 # 0 0 small NULL NULL 1048576 1024 # # 0 0 # 0 0
select * from t1 where p between 1010 and 1020 ; select * from t1 where p between 1010 and 1020 ;
...@@ -587,34 +587,34 @@ p i a ...@@ -587,34 +587,34 @@ p i a
1018 2 pppp 1018 2 pppp
1019 2 yyyy 1019 2 yyyy
1020 3 zzzz 1020 3 zzzz
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 6750 # 3684 103 default 2 NULL 32768 1024 # # 0 6750 # 3684 103
small NULL NULL 1048576 1024 # # 0 0 # 0 0 small NULL NULL 1048576 1024 # # 0 0 # 0 0
flush tables; flush tables;
flush status; flush status;
update t1 set a='zzzz' where a='qqqq'; update t1 set a='zzzz' where a='qqqq';
update t2 set i=1 where i=2; update t2 set i=1 where i=2;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3076 18 1552 18 default 2 NULL 32768 1024 # # 0 3076 18 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
set global keycache1.key_buffer_size=256*1024; set global keycache1.key_buffer_size=256*1024;
select @@keycache1.key_buffer_size; select @@keycache1.key_buffer_size;
@@keycache1.key_buffer_size @@keycache1.key_buffer_size
262144 262144
set global keycache1.key_cache_partitions=7; set global keycache1.key_cache_segments=7;
select @@keycache1.key_cache_partitions; select @@keycache1.key_cache_segments;
@@keycache1.key_cache_partitions @@keycache1.key_cache_segments
7 7
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3076 18 1552 18 default 2 NULL 32768 1024 # # 0 3076 18 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 262143 2048 # # 0 0 0 0 0 keycache1 7 NULL 262143 2048 # # 0 0 0 0 0
select * from information_schema.key_caches where key_cache_name like "key%" select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null; and segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
keycache1 7 NULL 262143 2048 0 # 0 0 0 0 0 keycache1 7 NULL 262143 2048 0 # 0 0 0 0 0
cache index t1 key (`primary`) in keycache1; cache index t1 key (`primary`) in keycache1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
...@@ -647,22 +647,22 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -647,22 +647,22 @@ id select_type table type possible_keys key key_len ref rows Extra
select count(*) from t1, t2 where t1.p = t2.i; select count(*) from t1, t2 where t1.p = t2.i;
count(*) count(*)
256 256
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 262143 2048 # # 0 14 3 0 0 keycache1 7 NULL 262143 2048 # # 0 14 3 0 0
select * from information_schema.key_caches where key_cache_name like "key%" select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null; and segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
keycache1 7 NULL 262143 2048 3 # 0 14 3 0 0 keycache1 7 NULL 262143 2048 3 # 0 14 3 0 0
cache index t2 in keycache1; cache index t2 in keycache1;
Table Op Msg_type Msg_text Table Op Msg_type Msg_text
test.t2 assign_to_keycache status OK test.t2 assign_to_keycache status OK
update t2 set p=p+3000, i=2 where a='qqqq'; update t2 set p=p+3000, i=2 where a='qqqq';
select * from information_schema.key_caches where key_cache_name like "key%" select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null; and segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19 keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19
set global keycache2.key_buffer_size=1024*1024; set global keycache2.key_buffer_size=1024*1024;
cache index t2 in keycache2; cache index t2 in keycache2;
...@@ -670,12 +670,12 @@ Table Op Msg_type Msg_text ...@@ -670,12 +670,12 @@ Table Op Msg_type Msg_text
test.t2 assign_to_keycache status OK test.t2 assign_to_keycache status OK
insert into t2 values (2000, 3, 'yyyy'); insert into t2 values (2000, 3, 'yyyy');
select * from information_schema.key_caches where key_cache_name like "keycache2" select * from information_schema.key_caches where key_cache_name like "keycache2"
and partition_number is null; and segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3
select * from information_schema.key_caches where key_cache_name like "key%" select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null; and segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19 keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19
keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3
cache index t2 in keycache1; cache index t2 in keycache1;
...@@ -713,81 +713,81 @@ id select_type table type possible_keys key key_len ref rows Extra ...@@ -713,81 +713,81 @@ id select_type table type possible_keys key key_len ref rows Extra
select a from t2 where a='yyyy' and i=3 ; select a from t2 where a='yyyy' and i=3 ;
a a
yyyy yyyy
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 262143 2048 # # 0 3201 43 1594 30 keycache1 7 NULL 262143 2048 # # 0 3201 43 1594 30
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=2*1024; set global keycache1.key_cache_block_size=2*1024;
insert into t2 values (7000, 3, 'yyyy'); insert into t2 values (7000, 3, 'yyyy');
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 262143 2048 # # 0 6 6 3 3 keycache1 7 NULL 262143 2048 # # 0 6 6 3 3
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024; set global keycache1.key_cache_block_size=8*1024;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 3 NULL 262143 8192 # # 0 0 0 0 0 keycache1 3 NULL 262143 8192 # # 0 0 0 0 0
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
insert into t2 values (8000, 3, 'yyyy'); insert into t2 values (8000, 3, 'yyyy');
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 3 NULL 262143 8192 # # 0 6 5 3 3 keycache1 3 NULL 262143 8192 # # 0 6 5 3 3
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=64*1024; set global keycache1.key_buffer_size=64*1024;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=2*1024; set global keycache1.key_cache_block_size=2*1024;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 3 NULL 65535 2048 # # 0 0 0 0 0 keycache1 3 NULL 65535 2048 # # 0 0 0 0 0
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024; set global keycache1.key_cache_block_size=8*1024;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=0; set global keycache1.key_buffer_size=0;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=8*1024; set global keycache1.key_cache_block_size=8*1024;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=0; set global keycache1.key_buffer_size=0;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_buffer_size=128*1024; set global keycache1.key_buffer_size=128*1024;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 1 NULL 131072 8192 # # 0 0 0 0 0 keycache1 1 NULL 131072 8192 # # 0 0 0 0 0
keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3
set global keycache1.key_cache_block_size=1024; set global keycache1.key_cache_block_size=1024;
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
KEY_CACHE_NAME PARTITIONS PARTITION_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES
default 2 NULL 32768 1024 # # 0 3172 24 1552 18 default 2 NULL 32768 1024 # # 0 3172 24 1552 18
small NULL NULL 1048576 1024 # # 0 0 0 0 0 small NULL NULL 1048576 1024 # # 0 0 0 0 0
keycache1 7 NULL 131068 1024 # # 0 0 0 0 0 keycache1 7 NULL 131068 1024 # # 0 0 0 0 0
...@@ -796,4 +796,4 @@ drop table t1,t2; ...@@ -796,4 +796,4 @@ drop table t1,t2;
set global keycache1.key_buffer_size=0; set global keycache1.key_buffer_size=0;
set global keycache2.key_buffer_size=0; set global keycache2.key_buffer_size=0;
set global key_buffer_size=@save_key_buffer_size; set global key_buffer_size=@save_key_buffer_size;
set global key_cache_partitions=@save_key_cache_partitions; set global key_cache_segments=@save_key_cache_segments;
...@@ -234,10 +234,10 @@ NULL information_schema KEY_CACHES BLOCK_SIZE 5 0 NO bigint NULL NULL 19 0 NULL ...@@ -234,10 +234,10 @@ NULL information_schema KEY_CACHES BLOCK_SIZE 5 0 NO bigint NULL NULL 19 0 NULL
NULL information_schema KEY_CACHES DIRTY_BLOCKS 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema KEY_CACHES DIRTY_BLOCKS 8 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema KEY_CACHES FULL_SIZE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema KEY_CACHES FULL_SIZE 4 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema KEY_CACHES KEY_CACHE_NAME 1 NO varchar 192 576 NULL NULL utf8 utf8_general_ci varchar(192) select NULL information_schema KEY_CACHES KEY_CACHE_NAME 1 NO varchar 192 576 NULL NULL utf8 utf8_general_ci varchar(192) select
NULL information_schema KEY_CACHES PARTITIONS 2 NULL YES int NULL NULL 10 0 NULL NULL int(3) unsigned select
NULL information_schema KEY_CACHES PARTITION_NUMBER 3 NULL YES int NULL NULL 10 0 NULL NULL int(3) unsigned select
NULL information_schema KEY_CACHES READS 10 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema KEY_CACHES READS 10 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema KEY_CACHES READ_REQUESTS 9 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema KEY_CACHES READ_REQUESTS 9 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema KEY_CACHES SEGMENTS 2 NULL YES int NULL NULL 10 0 NULL NULL int(3) unsigned select
NULL information_schema KEY_CACHES SEGMENT_NUMBER 3 NULL YES int NULL NULL 10 0 NULL NULL int(3) unsigned select
NULL information_schema KEY_CACHES UNUSED_BLOCKS 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema KEY_CACHES UNUSED_BLOCKS 7 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema KEY_CACHES USED_BLOCKS 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema KEY_CACHES USED_BLOCKS 6 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
NULL information_schema KEY_CACHES WRITES 12 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select NULL information_schema KEY_CACHES WRITES 12 0 NO bigint NULL NULL 19 0 NULL NULL bigint(21) unsigned select
...@@ -756,8 +756,8 @@ NULL information_schema INNODB_TRX trx_weight bigint NULL NULL NULL NULL bigint( ...@@ -756,8 +756,8 @@ NULL information_schema INNODB_TRX trx_weight bigint NULL NULL NULL NULL bigint(
NULL information_schema INNODB_TRX trx_mysql_thread_id bigint NULL NULL NULL NULL bigint(21) unsigned NULL information_schema INNODB_TRX trx_mysql_thread_id bigint NULL NULL NULL NULL bigint(21) unsigned
3.0000 information_schema INNODB_TRX trx_query varchar 1024 3072 utf8 utf8_general_ci varchar(1024) 3.0000 information_schema INNODB_TRX trx_query varchar 1024 3072 utf8 utf8_general_ci varchar(1024)
3.0000 information_schema KEY_CACHES KEY_CACHE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192) 3.0000 information_schema KEY_CACHES KEY_CACHE_NAME varchar 192 576 utf8 utf8_general_ci varchar(192)
NULL information_schema KEY_CACHES PARTITIONS int NULL NULL NULL NULL int(3) unsigned NULL information_schema KEY_CACHES SEGMENTS int NULL NULL NULL NULL int(3) unsigned
NULL information_schema KEY_CACHES PARTITION_NUMBER int NULL NULL NULL NULL int(3) unsigned NULL information_schema KEY_CACHES SEGMENT_NUMBER int NULL NULL NULL NULL int(3) unsigned
NULL information_schema KEY_CACHES FULL_SIZE bigint NULL NULL NULL NULL bigint(21) unsigned NULL information_schema KEY_CACHES FULL_SIZE bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema KEY_CACHES BLOCK_SIZE bigint NULL NULL NULL NULL bigint(21) unsigned NULL information_schema KEY_CACHES BLOCK_SIZE bigint NULL NULL NULL NULL bigint(21) unsigned
NULL information_schema KEY_CACHES USED_BLOCKS bigint NULL NULL NULL NULL bigint(21) unsigned NULL information_schema KEY_CACHES USED_BLOCKS bigint NULL NULL NULL NULL bigint(21) unsigned
......
# #
# Test of multiple key caches, simple an partitioned # Test of multiple key caches, simple and segmented
# #
--disable_warnings --disable_warnings
drop table if exists t1, t2, t3; drop table if exists t1, t2, t3;
...@@ -7,7 +7,7 @@ drop table if exists t1, t2, t3; ...@@ -7,7 +7,7 @@ drop table if exists t1, t2, t3;
SET @save_key_buffer_size=@@key_buffer_size; SET @save_key_buffer_size=@@key_buffer_size;
SET @save_key_cache_block_size=@@key_cache_block_size; SET @save_key_cache_block_size=@@key_cache_block_size;
SET @save_key_cache_partitions=@@key_cache_partitions; SET @save_key_cache_segments=@@key_cache_segments;
SELECT @@key_buffer_size, @@small.key_buffer_size; SELECT @@key_buffer_size, @@small.key_buffer_size;
...@@ -250,8 +250,10 @@ DROP TABLE t1; ...@@ -250,8 +250,10 @@ DROP TABLE t1;
# End of 4.1 tests # End of 4.1 tests
# End of 5.1 tests
# #
# Test cases for partitioned key caches # Test cases for segmented key caches
# #
# Test usage of the KEY_CACHE table from information schema # Test usage of the KEY_CACHE table from information schema
...@@ -261,7 +263,7 @@ set global key_buffer_size=@save_key_buffer_size; ...@@ -261,7 +263,7 @@ set global key_buffer_size=@save_key_buffer_size;
set global key_cache_block_size=@save_key_cache_block_size; set global key_cache_block_size=@save_key_cache_block_size;
select @@key_buffer_size; select @@key_buffer_size;
select @@key_cache_block_size; select @@key_cache_block_size;
select @@key_cache_partitions; select @@key_cache_segments;
create table t1 ( create table t1 (
p int not null auto_increment primary key, p int not null auto_increment primary key,
...@@ -270,9 +272,9 @@ create table t2 ( ...@@ -270,9 +272,9 @@ create table t2 (
p int not null auto_increment primary key, p int not null auto_increment primary key,
i int, a char(10), key k1(i), key k2(a)); i int, a char(10), key k1(i), key k2(a));
select @@key_cache_partitions; select @@key_cache_segments;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
insert into t1 values (1, 'qqqq'), (2, 'yyyy'); insert into t1 values (1, 'qqqq'), (2, 'yyyy');
insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
...@@ -285,26 +287,26 @@ update t2 set i=2 where i=1; ...@@ -285,26 +287,26 @@ update t2 set i=2 where i=1;
--replace_result 1808 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED --replace_result 1808 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED
show status like 'key_%'; show status like 'key_%';
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
delete from t2 where a='zzzz'; delete from t2 where a='zzzz';
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
delete from t1; delete from t1;
delete from t2; delete from t2;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
# For the key cache with 2 partitions execute the same sequence of # For the key cache with 2 segments execute the same sequence of
# statements as for the simple cache above. # statements as for the simple cache above.
# The statistical information on the number of i/o requests and # The statistical information on the number of i/o requests and
# the number of is expected to be the same. # the number of is expected to be the same.
set global key_cache_partitions=2; set global key_cache_segments=2;
select @@key_cache_partitions; select @@key_cache_segments;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
insert into t1 values (1, 'qqqq'), (2, 'yyyy'); insert into t1 values (1, 'qqqq'), (2, 'yyyy');
insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
...@@ -317,19 +319,19 @@ update t2 set i=2 where i=1; ...@@ -317,19 +319,19 @@ update t2 set i=2 where i=1;
--replace_result 1808 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1788 KEY_BLOCKS_UNUSED --replace_result 1808 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1788 KEY_BLOCKS_UNUSED
show status like 'key_%'; show status like 'key_%';
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
delete from t1; delete from t1;
delete from t2; delete from t2;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
# Check that we can work with one partition with the same results # Check that we can work with one segment with the same results
set global key_cache_partitions=1; set global key_cache_segments=1;
select @@key_cache_partitions; select @@key_cache_segments;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
insert into t1 values (1, 'qqqq'), (2, 'yyyy'); insert into t1 values (1, 'qqqq'), (2, 'yyyy');
insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
...@@ -342,25 +344,25 @@ update t2 set i=2 where i=1; ...@@ -342,25 +344,25 @@ update t2 set i=2 where i=1;
--replace_result 1808 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED --replace_result 1808 KEY_BLOCKS_UNUSED 1670 KEY_BLOCKS_UNUSED 1789 KEY_BLOCKS_UNUSED
show status like 'key_%'; show status like 'key_%';
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
delete from t1; delete from t1;
delete from t2; delete from t2;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
flush tables; flush status; flush tables; flush status;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
# Switch back to 2 partitions # Switch back to 2 segments
set global key_buffer_size=32*1024; set global key_buffer_size=32*1024;
select @@key_buffer_size; select @@key_buffer_size;
set global key_cache_partitions=2; set global key_cache_segments=2;
select @@key_cache_partitions; select @@key_cache_segments;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
insert into t1 values (1, 'qqqq'), (2, 'yyyy'); insert into t1 values (1, 'qqqq'), (2, 'yyyy');
insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), insert into t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'),
...@@ -371,7 +373,7 @@ update t1 set p=3 where p=1; ...@@ -371,7 +373,7 @@ update t1 set p=3 where p=1;
update t2 set i=2 where i=1; update t2 set i=2 where i=1;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
# Add more rows to tables t1 and t2 # Add more rows to tables t1 and t2
...@@ -394,31 +396,31 @@ insert into t2(i,a) select i,a from t2; ...@@ -394,31 +396,31 @@ insert into t2(i,a) select i,a from t2;
insert into t2(i,a) select i,a from t2; insert into t2(i,a) select i,a from t2;
--replace_column 6 # 7 # 10 # --replace_column 6 # 7 # 10 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
select * from t1 where p between 1010 and 1020 ; select * from t1 where p between 1010 and 1020 ;
select * from t2 where p between 1010 and 1020 ; select * from t2 where p between 1010 and 1020 ;
--replace_column 6 # 7 # 10 # --replace_column 6 # 7 # 10 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
flush tables; flush status; flush tables; flush status;
update t1 set a='zzzz' where a='qqqq'; update t1 set a='zzzz' where a='qqqq';
update t2 set i=1 where i=2; update t2 set i=1 where i=2;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
# Now test how we can work with 7 partitions # Now test how we can work with 7 segments
set global keycache1.key_buffer_size=256*1024; set global keycache1.key_buffer_size=256*1024;
select @@keycache1.key_buffer_size; select @@keycache1.key_buffer_size;
set global keycache1.key_cache_partitions=7; set global keycache1.key_cache_segments=7;
select @@keycache1.key_cache_partitions; select @@keycache1.key_cache_segments;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where key_cache_name like "key%" select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null; and segment_number is null;
cache index t1 key (`primary`) in keycache1; cache index t1 key (`primary`) in keycache1;
...@@ -430,26 +432,26 @@ explain select count(*) from t1, t2 where t1.p = t2.i; ...@@ -430,26 +432,26 @@ explain select count(*) from t1, t2 where t1.p = t2.i;
select count(*) from t1, t2 where t1.p = t2.i; select count(*) from t1, t2 where t1.p = t2.i;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where key_cache_name like "key%" select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null; and segment_number is null;
cache index t2 in keycache1; cache index t2 in keycache1;
update t2 set p=p+3000, i=2 where a='qqqq'; update t2 set p=p+3000, i=2 where a='qqqq';
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where key_cache_name like "key%" select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null; and segment_number is null;
set global keycache2.key_buffer_size=1024*1024; set global keycache2.key_buffer_size=1024*1024;
cache index t2 in keycache2; cache index t2 in keycache2;
insert into t2 values (2000, 3, 'yyyy'); insert into t2 values (2000, 3, 'yyyy');
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where key_cache_name like "keycache2" select * from information_schema.key_caches where key_cache_name like "keycache2"
and partition_number is null; and segment_number is null;
--replace_column 7 # --replace_column 7 #
select * from information_schema.key_caches where key_cache_name like "key%" select * from information_schema.key_caches where key_cache_name like "key%"
and partition_number is null; and segment_number is null;
cache index t2 in keycache1; cache index t2 in keycache1;
update t2 set p=p+5000 where a='zzzz'; update t2 set p=p+5000 where a='zzzz';
...@@ -461,51 +463,51 @@ select i from t2 where a='yyyy' and i=3; ...@@ -461,51 +463,51 @@ select i from t2 where a='yyyy' and i=3;
explain select a from t2 where a='yyyy' and i=3; explain select a from t2 where a='yyyy' and i=3;
select a from t2 where a='yyyy' and i=3 ; select a from t2 where a='yyyy' and i=3 ;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_cache_block_size=2*1024; set global keycache1.key_cache_block_size=2*1024;
insert into t2 values (7000, 3, 'yyyy'); insert into t2 values (7000, 3, 'yyyy');
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_cache_block_size=8*1024; set global keycache1.key_cache_block_size=8*1024;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
insert into t2 values (8000, 3, 'yyyy'); insert into t2 values (8000, 3, 'yyyy');
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_buffer_size=64*1024; set global keycache1.key_buffer_size=64*1024;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_cache_block_size=2*1024; set global keycache1.key_cache_block_size=2*1024;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_cache_block_size=8*1024; set global keycache1.key_cache_block_size=8*1024;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_buffer_size=0; set global keycache1.key_buffer_size=0;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_cache_block_size=8*1024; set global keycache1.key_cache_block_size=8*1024;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_buffer_size=0; set global keycache1.key_buffer_size=0;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_buffer_size=128*1024; set global keycache1.key_buffer_size=128*1024;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
set global keycache1.key_cache_block_size=1024; set global keycache1.key_cache_block_size=1024;
--replace_column 6 # 7 # --replace_column 6 # 7 #
select * from information_schema.key_caches where partition_number is null; select * from information_schema.key_caches where segment_number is null;
drop table t1,t2; drop table t1,t2;
...@@ -513,6 +515,6 @@ set global keycache1.key_buffer_size=0; ...@@ -513,6 +515,6 @@ set global keycache1.key_buffer_size=0;
set global keycache2.key_buffer_size=0; set global keycache2.key_buffer_size=0;
set global key_buffer_size=@save_key_buffer_size; set global key_buffer_size=@save_key_buffer_size;
set global key_cache_partitions=@save_key_cache_partitions; set global key_cache_segments=@save_key_cache_segments;
#End of 5.1 tests # End of 5.2 tests
--key_cache_partitions=7 --key_cache_segments=7
# #
# Run select.test partitioned default key cache (with 7 partitions) # Run select.test with the segmented default key cache (with 7 segments)
# (see setting the number of partitions in select_pkecache-master.opt) # (see setting the number of segments in select_pkecache-master.opt)
# The result is expected the same as for select.test # The result is expected the same as for select.test
# #
......
...@@ -6939,13 +6939,13 @@ log and this option does nothing anymore.", ...@@ -6939,13 +6939,13 @@ log and this option does nothing anymore.",
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG,
KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0}, KEY_CACHE_BLOCK_SIZE, 512, 1024 * 16, 0, 512, 0},
{"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT, {"key_cache_division_limit", OPT_KEY_CACHE_DIVISION_LIMIT,
"The minimum percentage of warm blocks in key cache", "The minimum percentage of warm blocks in a key cache",
(uchar**) &dflt_key_cache_var.param_division_limit, (uchar**) &dflt_key_cache_var.param_division_limit,
(uchar**) 0, (uchar**) 0,
0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100, 0, (GET_ULONG | GET_ASK_ADDR) , REQUIRED_ARG, 100,
1, 100, 0, 1, 0}, 1, 100, 0, 1, 0},
{"key_cache_partitions", OPT_KEY_CACHE_PARTITIONS, {"key_cache_segments", OPT_KEY_CACHE_PARTITIONS,
"The number of partitions in key cache", "The number of segments in a key cache",
(uchar**) &dflt_key_cache_var.param_partitions, (uchar**) &dflt_key_cache_var.param_partitions,
(uchar**) 0, (uchar**) 0,
0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, DEFAULT_KEY_CACHE_PARTITIONS, 0, (GET_ULONG | GET_ASK_ADDR), REQUIRED_ARG, DEFAULT_KEY_CACHE_PARTITIONS,
......
...@@ -330,7 +330,7 @@ static sys_var_key_cache_long sys_key_cache_age_threshold(&vars, ...@@ -330,7 +330,7 @@ static sys_var_key_cache_long sys_key_cache_age_threshold(&vars,
"key_cache_age_threshold", "key_cache_age_threshold",
offsetof(KEY_CACHE, param_age_threshold)); offsetof(KEY_CACHE, param_age_threshold));
static sys_var_key_cache_long sys_key_cache_partitions(&vars, static sys_var_key_cache_long sys_key_cache_partitions(&vars,
"key_cache_partitions", "key_cache_segments",
offsetof(KEY_CACHE, param_partitions)); offsetof(KEY_CACHE, param_partitions));
static sys_var_const sys_language(&vars, "language", static sys_var_const sys_language(&vars, "language",
OPT_GLOBAL, SHOW_CHAR, OPT_GLOBAL, SHOW_CHAR,
......
...@@ -7366,9 +7366,9 @@ ST_FIELD_INFO referential_constraints_fields_info[]= ...@@ -7366,9 +7366,9 @@ ST_FIELD_INFO referential_constraints_fields_info[]=
ST_FIELD_INFO keycache_fields_info[]= ST_FIELD_INFO keycache_fields_info[]=
{ {
{"KEY_CACHE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE}, {"KEY_CACHE_NAME", NAME_LEN, MYSQL_TYPE_STRING, 0, 0, 0, SKIP_OPEN_TABLE},
{"PARTITIONS", 3, MYSQL_TYPE_LONG, 0, {"SEGMENTS", 3, MYSQL_TYPE_LONG, 0,
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED) , 0, SKIP_OPEN_TABLE}, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED) , 0, SKIP_OPEN_TABLE},
{"PARTITION_NUMBER", 3, MYSQL_TYPE_LONG, 0, {"SEGMENT_NUMBER", 3, MYSQL_TYPE_LONG, 0,
(MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, SKIP_OPEN_TABLE}, (MY_I_S_MAYBE_NULL | MY_I_S_UNSIGNED), 0, SKIP_OPEN_TABLE},
{"FULL_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0, {"FULL_SIZE", MY_INT64_NUM_DECIMAL_DIGITS, MYSQL_TYPE_LONGLONG, 0,
(MY_I_S_UNSIGNED), 0, SKIP_OPEN_TABLE}, (MY_I_S_UNSIGNED), 0, SKIP_OPEN_TABLE},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment