preload.result 3.82 KB
Newer Older
unknown's avatar
unknown committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
drop table if exists t1, t2;
create table t1 (
a int not null auto_increment,
b char(16) not null,
primary key (a),
key (b)
);
create table t2(
a int not null auto_increment,
b char(16) not null,
primary key (a),
key (b)
);
insert into t1(b) values 
('test0'),
('test1'),
('test2'),
('test3'),
('test4'),
('test5'),
('test6'),
('test7');
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
insert into t2(b) select b from t1;
insert into t1(b) select b from t2;
select count(*) from t1;
count(*)
33448
select count(*) from t2;
count(*)
20672
flush tables;
flush status;
unknown's avatar
unknown committed
49
show status like "key_read%";
unknown's avatar
unknown committed
50 51 52 53 54 55
Variable_name	Value
Key_read_requests	0
Key_reads	0
select count(*) from t1 where b = 'test1';
count(*)
4181
unknown's avatar
unknown committed
56
show status like "key_read%";
unknown's avatar
unknown committed
57
Variable_name	Value
58 59
Key_read_requests	294
Key_reads	60
unknown's avatar
unknown committed
60 61 62
select count(*) from t1 where b = 'test1';
count(*)
4181
unknown's avatar
unknown committed
63
show status like "key_read%";
unknown's avatar
unknown committed
64
Variable_name	Value
65 66
Key_read_requests	588
Key_reads	60
unknown's avatar
unknown committed
67 68 69 70 71
flush tables;
flush status;
select @@preload_buffer_size;
@@preload_buffer_size
32768
72
load index into cache t1;
unknown's avatar
unknown committed
73 74
Table	Op	Msg_type	Msg_text
test.t1	preload_keys	status	OK
unknown's avatar
unknown committed
75
show status like "key_read%";
unknown's avatar
unknown committed
76
Variable_name	Value
77 78
Key_read_requests	774
Key_reads	774
unknown's avatar
unknown committed
79 80 81
select count(*) from t1 where b = 'test1';
count(*)
4181
unknown's avatar
unknown committed
82
show status like "key_read%";
unknown's avatar
unknown committed
83
Variable_name	Value
84 85
Key_read_requests	1068
Key_reads	774
unknown's avatar
unknown committed
86 87
flush tables;
flush status;
unknown's avatar
unknown committed
88
show status like "key_read%";
unknown's avatar
unknown committed
89 90 91 92 93 94 95
Variable_name	Value
Key_read_requests	0
Key_reads	0
set session preload_buffer_size=256*1024;
select @@preload_buffer_size;
@@preload_buffer_size
262144
96
load index into cache t1 ignore leaves;
unknown's avatar
unknown committed
97 98
Table	Op	Msg_type	Msg_text
test.t1	preload_keys	status	OK
unknown's avatar
unknown committed
99
show status like "key_read%";
unknown's avatar
unknown committed
100
Variable_name	Value
101 102
Key_read_requests	17
Key_reads	17
unknown's avatar
unknown committed
103 104 105
select count(*) from t1 where b = 'test1';
count(*)
4181
unknown's avatar
unknown committed
106
show status like "key_read%";
unknown's avatar
unknown committed
107
Variable_name	Value
108 109
Key_read_requests	311
Key_reads	75
unknown's avatar
unknown committed
110 111
flush tables;
flush status;
unknown's avatar
unknown committed
112
show status like "key_read%";
unknown's avatar
unknown committed
113 114 115 116 117 118 119
Variable_name	Value
Key_read_requests	0
Key_reads	0
set session preload_buffer_size=1*1024;
select @@preload_buffer_size;
@@preload_buffer_size
1024
120
load index into cache t1, t2 key (primary,b) ignore leaves;
unknown's avatar
unknown committed
121 122 123
Table	Op	Msg_type	Msg_text
test.t1	preload_keys	status	OK
test.t2	preload_keys	status	OK
unknown's avatar
unknown committed
124
show status like "key_read%";
unknown's avatar
unknown committed
125
Variable_name	Value
126 127
Key_read_requests	785
Key_reads	785
unknown's avatar
unknown committed
128 129 130 131 132 133
select count(*) from t1 where b = 'test1';
count(*)
4181
select count(*) from t2 where b = 'test1';
count(*)
2584
unknown's avatar
unknown committed
134
show status like "key_read%";
unknown's avatar
unknown committed
135
Variable_name	Value
136 137
Key_read_requests	1266
Key_reads	821
unknown's avatar
unknown committed
138 139
flush tables;
flush status;
unknown's avatar
unknown committed
140
show status like "key_read%";
unknown's avatar
unknown committed
141 142 143
Variable_name	Value
Key_read_requests	0
Key_reads	0
144
load index into cache t3, t2 key (primary,b) ;
unknown's avatar
unknown committed
145
Table	Op	Msg_type	Msg_text
146 147
test.t3	preload_keys	Error	Table 'test.t3' doesn't exist
test.t3	preload_keys	error	Corrupt
unknown's avatar
unknown committed
148
test.t2	preload_keys	status	OK
unknown's avatar
unknown committed
149
show status like "key_read%";
unknown's avatar
unknown committed
150
Variable_name	Value
151 152
Key_read_requests	478
Key_reads	478
unknown's avatar
unknown committed
153 154
flush tables;
flush status;
unknown's avatar
unknown committed
155
show status like "key_read%";
unknown's avatar
unknown committed
156 157 158
Variable_name	Value
Key_read_requests	0
Key_reads	0
159
load index into cache t3 key (b), t2 key (c) ;
unknown's avatar
unknown committed
160
Table	Op	Msg_type	Msg_text
161 162 163
test.t3	preload_keys	Error	Table 'test.t3' doesn't exist
test.t3	preload_keys	error	Corrupt
test.t2	preload_keys	Error	Key 'c' doesn't exist in table 't2'
unknown's avatar
unknown committed
164
test.t2	preload_keys	status	Operation failed
unknown's avatar
unknown committed
165
show status like "key_read%";
unknown's avatar
unknown committed
166 167 168 169
Variable_name	Value
Key_read_requests	0
Key_reads	0
drop table t1, t2;