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
|
drop table if exists t;
create table t (a int not null, b int not null, c int not null, d int not null, primary key(a,b), key(c,a)) engine=tokudb;
insert into t values (0,0,0,0),(0,1,0,1);
explain select c,a,b from t where c=0 and a=0 and b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t const PRIMARY,c PRIMARY 8 const,const 1
flush status;
select c,a,b from t where c=0 and a=0 and b=1;
c a b
0 0 1
show status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
explain select c,a,b from t force index (c) where c=0 and a=0 and b=1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t const c c 12 const,const,const 1 Using index
flush status;
select c,a,b from t force index (c) where c=0 and a=0 and b=1;
c a b
0 0 1
show status like 'handler_read%';
Variable_name Value
Handler_read_first 0
Handler_read_key 1
Handler_read_last 0
Handler_read_next 0
Handler_read_prev 0
Handler_read_retry 0
Handler_read_rnd 0
Handler_read_rnd_deleted 0
Handler_read_rnd_next 0
drop table t;
|