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
|
source include/have_tokudb.inc;
source include/have_innodb.inc;
disable_warnings;
drop table if exists t;
enable_warnings;
select @@optimizer_switch;
create table t (id int not null, x int not null, y int not null, primary key(id), key(x)) engine=innodb;
insert into t values (0,0,0),(1,1,1),(2,2,2),(3,2,3),(4,2,4);
explain select x,id from t force index (x) where x=0 and id=0;
flush status;
select x,id from t force index (x) where x=0 and id=0;
show status like 'handler_read%';
explain select y,id from t force index (x) where x=0 and id=0;
flush status;
select y,id from t force index (x) where x=0 and id=0;
show status like 'handler_read%';
explain select x,id from t force index (x) where x=0 and id=1;
flush status;
select x,id from t force index (x) where x=0 and id=1;
show status like 'handler_read%';
explain select y,id from t force index (x)where x=0 and id=1;
flush status;
select y,id from t force index(x) where x=0 and id=1;
show status like 'handler_read%';
explain select x,id from t force index (x) where x=2 and id=3;
flush status;
select x,id from t force index (x) where x=2 and id=3;
show status like 'handler_read%';
explain select x,id from t force index (x) where x=2 and id=0;
flush status;
select x,id from t force index (x) where x=2 and id=0;
show status like 'handler_read%';
drop table t;
|