diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-05-26 18:33:40 +0200 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-05-26 18:33:40 +0200 |
commit | e44633c8778354e5f9f71dd7e66fa972f9caeed0 (patch) | |
tree | b5e07513106452afcbb19dfe251a30e525e0450a /mysql-test/t/key_cache.test | |
parent | 5379038af9f279b3ad15e74c7147608fd8f899ea (diff) | |
download | mariadb-git-e44633c8778354e5f9f71dd7e66fa972f9caeed0.tar.gz |
rename "partitioned key cache" to "segmented"
Diffstat (limited to 'mysql-test/t/key_cache.test')
-rw-r--r-- | mysql-test/t/key_cache.test | 110 |
1 files changed, 56 insertions, 54 deletions
diff --git a/mysql-test/t/key_cache.test b/mysql-test/t/key_cache.test index 274e47ec6ca..d77ce243e32 100644 --- a/mysql-test/t/key_cache.test +++ b/mysql-test/t/key_cache.test @@ -1,5 +1,5 @@ # -# Test of multiple key caches, simple an partitioned +# Test of multiple key caches, simple and segmented # --disable_warnings 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_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; @@ -250,8 +250,10 @@ DROP TABLE t1; # 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 @@ -261,7 +263,7 @@ set global key_buffer_size=@save_key_buffer_size; set global key_cache_block_size=@save_key_cache_block_size; select @@key_buffer_size; select @@key_cache_block_size; -select @@key_cache_partitions; +select @@key_cache_segments; create table t1 ( p int not null auto_increment primary key, @@ -270,9 +272,9 @@ create table t2 ( p int not null auto_increment primary key, i int, a char(10), key k1(i), key k2(a)); -select @@key_cache_partitions; +select @@key_cache_segments; --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 t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), @@ -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 show status like 'key_%'; --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'; --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 t2; --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. # The statistical information on the number of i/o requests and # the number of is expected to be the same. -set global key_cache_partitions=2; -select @@key_cache_partitions; +set global key_cache_segments=2; +select @@key_cache_segments; --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 t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), @@ -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 show status like 'key_%'; --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 t2; --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; -select @@key_cache_partitions; +set global key_cache_segments=1; +select @@key_cache_segments; --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 t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), @@ -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 show status like 'key_%'; --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 t2; --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; --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; select @@key_buffer_size; -set global key_cache_partitions=2; -select @@key_cache_partitions; +set global key_cache_segments=2; +select @@key_cache_segments; --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 t2 values (1, 1, 'qqqq'), (2, 1, 'pppp'), @@ -371,7 +373,7 @@ update t1 set p=3 where p=1; update t2 set i=2 where i=1; --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 @@ -394,31 +396,31 @@ 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 # -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 t2 where p between 1010 and 1020 ; --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; update t1 set a='zzzz' where a='qqqq'; update t2 set i=1 where i=2; --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; select @@keycache1.key_buffer_size; -set global keycache1.key_cache_partitions=7; -select @@keycache1.key_cache_partitions; +set global keycache1.key_cache_segments=7; +select @@keycache1.key_cache_segments; --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 # 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; @@ -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; --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 # 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; update t2 set p=p+3000, i=2 where a='qqqq'; --replace_column 7 # 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; cache index t2 in keycache2; insert into t2 values (2000, 3, 'yyyy'); --replace_column 7 # 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 # 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; update t2 set p=p+5000 where a='zzzz'; @@ -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; select a from t2 where a='yyyy' and i=3 ; --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; insert into t2 values (7000, 3, 'yyyy'); --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; --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'); --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; --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; --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; --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; --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; --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; --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; --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; --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; @@ -513,6 +515,6 @@ set global keycache1.key_buffer_size=0; set global keycache2.key_buffer_size=0; 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 |