mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
03bc599706
mysql-test/r/ndb_cache.result: Added 'order by' to select's mysql-test/r/ndb_cache2.result: Added 'order by' to select's mysql-test/t/ndb_cache.test: Added 'order by' to select's mysql-test/t/ndb_cache2.test: Added 'order by' to select's sql/ha_innodb.h: Changed function name sql/ha_ndbcluster.cc: Merge from query cache from 4.1 to 5.0 Added better comments ndb_get_table_statistics had changed, so there where some adaptions to make sql/ha_ndbcluster.h: Changed name of function sql/handler.h: Changed name of function sql/sql_cache.cc: Changed name of function
191 lines
4.3 KiB
Text
191 lines
4.3 KiB
Text
drop table if exists t1;
|
|
set GLOBAL query_cache_type=on;
|
|
set GLOBAL query_cache_size=1355776;
|
|
reset query cache;
|
|
flush status;
|
|
CREATE TABLE t1 ( pk int not null primary key,
|
|
a int, b int not null, c varchar(20)) ENGINE=ndbcluster;
|
|
insert into t1 value (1, 2, 3, 'First row');
|
|
select * from t1;
|
|
pk a b c
|
|
1 2 3 First row
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 1
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 1
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 0
|
|
select * from t1;
|
|
pk a b c
|
|
1 2 3 First row
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 1
|
|
update t1 set a=3 where pk=1;
|
|
select * from t1;
|
|
pk a b c
|
|
1 3 3 First row
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 2
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 1
|
|
insert into t1 value (2, 7, 8, 'Second row');
|
|
insert into t1 value (4, 5, 6, 'Fourth row');
|
|
select * from t1 order by pk;
|
|
pk a b c
|
|
1 3 3 First row
|
|
2 7 8 Second row
|
|
4 5 6 Fourth row
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 3
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 1
|
|
select * from t1 order by pk;
|
|
pk a b c
|
|
1 3 3 First row
|
|
2 7 8 Second row
|
|
4 5 6 Fourth row
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 2
|
|
select * from t1 where b=3;
|
|
pk a b c
|
|
1 3 3 First row
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 2
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 2
|
|
select * from t1 where b=3;
|
|
pk a b c
|
|
1 3 3 First row
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 3
|
|
delete from t1 where c='Fourth row';
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 0
|
|
select * from t1 where b=3;
|
|
pk a b c
|
|
1 3 3 First row
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 3
|
|
use test;
|
|
select * from t1 order by pk;
|
|
pk a b c
|
|
1 3 3 First row
|
|
2 7 8 Second row
|
|
select * from t1 where b=3;
|
|
pk a b c
|
|
1 3 3 First row
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 4
|
|
update t1 set a=4 where b=3;
|
|
use test;
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 0
|
|
select * from t1 order by pk desc;
|
|
pk a b c
|
|
2 7 8 Second row
|
|
1 4 3 First row
|
|
select * from t1 order by pk desc;
|
|
pk a b c
|
|
2 7 8 Second row
|
|
1 4 3 First row
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 7
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 5
|
|
select * from t1 order by pk desc;
|
|
pk a b c
|
|
2 7 8 Second row
|
|
1 4 3 First row
|
|
select * from t1 order by pk desc;
|
|
pk a b c
|
|
2 7 8 Second row
|
|
1 4 3 First row
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 1
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 7
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 7
|
|
begin;
|
|
update t1 set a=5 where pk=1;
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 0
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 7
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 7
|
|
select * from t1 order by pk desc;
|
|
pk a b c
|
|
2 7 8 Second row
|
|
1 4 3 First row
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 1
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 8
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 7
|
|
commit;
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 1
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 8
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 7
|
|
select * from t1 order by pk desc;
|
|
pk a b c
|
|
2 7 8 Second row
|
|
1 5 3 First row
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 9
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 7
|
|
select * from t1 order by pk desc;
|
|
pk a b c
|
|
2 7 8 Second row
|
|
1 5 3 First row
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 1
|
|
show status like "Qcache_inserts";
|
|
Variable_name Value
|
|
Qcache_inserts 9
|
|
show status like "Qcache_hits";
|
|
Variable_name Value
|
|
Qcache_hits 8
|
|
drop table t1;
|
|
show status like "Qcache_queries_in_cache";
|
|
Variable_name Value
|
|
Qcache_queries_in_cache 0
|
|
SET GLOBAL query_cache_size=0;
|