1
SET SESSION STORAGE_ENGINE = InnoDB;
2
drop table if exists t1,t2,t3;
3
set @save_query_cache_size = @@global.query_cache_size;
4
set GLOBAL query_cache_size = 1355776;
7
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
8
insert into t1 values (1),(2),(3);
14
show status like "Qcache_queries_in_cache";
16
Qcache_queries_in_cache 0
21
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
22
insert into t1 values (1),(2),(3);
28
show status like "Qcache_queries_in_cache";
30
Qcache_queries_in_cache 0
33
create table t1 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
34
create table t2 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
35
create table t3 (a int not null) PARTITION BY KEY (a) PARTITIONS 3;
36
insert into t1 values (1),(2);
37
insert into t2 values (1),(2);
38
insert into t3 values (1),(2);
51
show status like "Qcache_queries_in_cache";
53
Qcache_queries_in_cache 0
54
show status like "Qcache_hits";
70
show status like "Qcache_queries_in_cache";
72
Qcache_queries_in_cache 0
73
show status like "Qcache_hits";
76
insert into t1 values (3);
77
insert into t2 values (3);
78
insert into t1 values (4);
94
show status like "Qcache_queries_in_cache";
96
Qcache_queries_in_cache 0
97
show status like "Qcache_hits";
101
show status like "Qcache_queries_in_cache";
103
Qcache_queries_in_cache 0
105
CREATE TABLE t1 (id int(11) NOT NULL auto_increment, PRIMARY KEY (id)) PARTITION BY HASH (id) PARTITIONS 3;
106
select count(*) from t1;
109
insert into t1 (id) values (0);
110
select count(*) from t1;
114
SET SESSION STORAGE_ENGINE = InnoDB;
117
SHOW VARIABLES LIKE 'have_query_cache';
120
SET GLOBAL query_cache_size = 204800;
123
SET SESSION STORAGE_ENGINE = InnoDB;
124
CREATE TABLE t2 (s1 int, s2 varchar(1000), key(s1)) PARTITION BY KEY (s1) PARTITIONS 3;
125
INSERT INTO t2 VALUES (1,repeat('a',10)),(2,repeat('a',10)),(3,repeat('a',10)),(4,repeat('a',10));
128
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
131
UPDATE t2 SET s2 = 'w' WHERE s1 = 3;
132
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
135
show status like "Qcache_queries_in_cache";
137
Qcache_queries_in_cache 0
138
connection connection1
140
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
143
INSERT INTO t2 VALUES (5,'w');
144
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
148
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
151
show status like "Qcache_queries_in_cache";
153
Qcache_queries_in_cache 0
155
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
159
show status like "Qcache_queries_in_cache";
161
Qcache_queries_in_cache 0
162
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
165
show status like "Qcache_queries_in_cache";
167
Qcache_queries_in_cache 0
168
connection connection1
169
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
173
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
176
INSERT INTO t2 VALUES (6,'w');
177
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
181
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
185
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
188
DELETE from t2 WHERE s1=3;
189
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
193
connection connection1
195
SELECT sql_cache count(*) FROM t2 WHERE s2 = 'w';
198
show status like "Qcache_queries_in_cache";
200
Qcache_queries_in_cache 0
201
show status like "Qcache_hits";
204
set @@global.query_cache_size = @save_query_cache_size;