|
|
|
@ -15,10 +15,10 @@ t1 CREATE TABLE `t1` ( |
|
|
|
`d` varchar(20) DEFAULT NULL, |
|
|
|
KEY `d2` (`d`) |
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
|
|
explain select * from t1 order by d; |
|
|
|
explain select * from t1 force index(d2) order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort |
|
|
|
select * from t1 order by d; |
|
|
|
1 SIMPLE t1 index NULL d2 23 NULL 4 |
|
|
|
select * from t1 force index (d2) order by d; |
|
|
|
a b c d |
|
|
|
3 4 ad ad |
|
|
|
2 3 ak ak |
|
|
|
@ -66,7 +66,7 @@ t1 CREATE TABLE `t1` ( |
|
|
|
KEY `b` (`b`), |
|
|
|
KEY `d` (`d`) |
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
|
|
explain select * from t1 order by c; |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 index NULL c 10 NULL 4 |
|
|
|
drop index c on t1; |
|
|
|
@ -102,10 +102,10 @@ t1 CREATE TABLE `t1` ( |
|
|
|
KEY `b` (`b`), |
|
|
|
KEY `d` (`d`) |
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1 |
|
|
|
explain select * from t1 order by c; |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort |
|
|
|
select * from t1 order by c; |
|
|
|
1 SIMPLE t1 index NULL c 10 NULL 4 |
|
|
|
select * from t1 force index(c) order by c; |
|
|
|
a b c d |
|
|
|
3 4 ad ad |
|
|
|
2 3 ak ak |
|
|
|
@ -133,36 +133,36 @@ a b c d |
|
|
|
4 4 tr tr |
|
|
|
5 5 oo oo |
|
|
|
6 1 ggg ggg |
|
|
|
select * from t1 order by b; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c d |
|
|
|
6 1 ggg ggg |
|
|
|
2 3 ak ak |
|
|
|
3 4 ad ad |
|
|
|
4 4 tr tr |
|
|
|
5 5 oo oo |
|
|
|
select * from t1 order by c; |
|
|
|
select * from t1 force index(c) order by c; |
|
|
|
a b c d |
|
|
|
3 4 ad ad |
|
|
|
2 3 ak ak |
|
|
|
6 1 ggg ggg |
|
|
|
5 5 oo oo |
|
|
|
4 4 tr tr |
|
|
|
select * from t1 order by d; |
|
|
|
select * from t1 force index(d) order by d; |
|
|
|
a b c d |
|
|
|
3 4 ad ad |
|
|
|
2 3 ak ak |
|
|
|
6 1 ggg ggg |
|
|
|
5 5 oo oo |
|
|
|
4 4 tr tr |
|
|
|
explain select * from t1 order by b; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
1 SIMPLE t1 index NULL b 5 NULL 5 |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
1 SIMPLE t1 index NULL c 10 NULL 5 |
|
|
|
explain select * from t1 force index(d) order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
1 SIMPLE t1 index NULL d 23 NULL 5 |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -211,21 +211,14 @@ a b c d |
|
|
|
3 3 ad ad |
|
|
|
4 4 afe afe |
|
|
|
5 1 ggg ggg |
|
|
|
select * from t1 order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
5 1 ggg ggg |
|
|
|
2 2 ac ac |
|
|
|
3 3 ad ad |
|
|
|
4 4 afe afe |
|
|
|
select * from t1 order by c; |
|
|
|
select * from t1 force index(c) order by c; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 3 ad ad |
|
|
|
4 4 afe afe |
|
|
|
5 1 ggg ggg |
|
|
|
select * from t1 order by d; |
|
|
|
select * from t1 force index(d) order by d; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -235,10 +228,10 @@ a b c d |
|
|
|
explain select * from t1 order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
explain select * from t1 force index(d) order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
show create table t1; |
|
|
|
@ -262,23 +255,7 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
5 1 ggg ggg |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
5 1 ggg ggg |
|
|
|
2 2 ac ac |
|
|
|
3 3 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by c; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 3 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
5 1 ggg ggg |
|
|
|
select * from t1 order by d; |
|
|
|
select * from t1 force index(c) order by c; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -289,7 +266,7 @@ a b c d |
|
|
|
explain select * from t1 order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
@ -318,36 +295,16 @@ a b c d |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by b; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by c; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by d; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
explain select * from t1 order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
1 SIMPLE t1 index NULL b 16 NULL 5 |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -368,23 +325,7 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
11 11 kkk kkk |
|
|
|
select * from t1 order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
11 11 kkk kkk |
|
|
|
select * from t1 order by c; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
11 11 kkk kkk |
|
|
|
select * from t1 order by d; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -392,15 +333,9 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
11 11 kkk kkk |
|
|
|
explain select * from t1 order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
1 SIMPLE t1 index NULL b 16 NULL 6 |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -423,7 +358,7 @@ a b c d |
|
|
|
8 9 fff fff |
|
|
|
11 11 kkk kkk |
|
|
|
13 13 yyy aaa |
|
|
|
select * from t1 order by b; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -432,7 +367,7 @@ a b c d |
|
|
|
8 9 fff fff |
|
|
|
11 11 kkk kkk |
|
|
|
13 13 yyy aaa |
|
|
|
select * from t1 order by c; |
|
|
|
select * from t1 force index(c) order by c; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -441,24 +376,12 @@ a b c d |
|
|
|
8 9 fff fff |
|
|
|
11 11 kkk kkk |
|
|
|
13 13 yyy aaa |
|
|
|
select * from t1 order by d; |
|
|
|
a b c d |
|
|
|
13 13 yyy aaa |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
11 11 kkk kkk |
|
|
|
explain select * from t1 order by b; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
1 SIMPLE t1 index NULL b 16 NULL 7 |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using filesort |
|
|
|
1 SIMPLE t1 index NULL c 34 NULL 7 |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -564,36 +487,6 @@ a b c d |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by c; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by d; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
explain select * from t1 order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -613,23 +506,7 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
10 10 kkk iii |
|
|
|
select * from t1 order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
10 10 kkk iii |
|
|
|
select * from t1 order by c; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
10 10 kkk iii |
|
|
|
select * from t1 order by d; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -637,15 +514,9 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
10 10 kkk iii |
|
|
|
explain select * from t1 order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
1 SIMPLE t1 index NULL b 5 NULL 6 |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -667,7 +538,7 @@ a b c d |
|
|
|
8 9 fff fff |
|
|
|
10 10 kkk iii |
|
|
|
11 11 aaa mmm |
|
|
|
select * from t1 order by b; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -676,7 +547,7 @@ a b c d |
|
|
|
8 9 fff fff |
|
|
|
10 10 kkk iii |
|
|
|
11 11 aaa mmm |
|
|
|
select * from t1 order by c; |
|
|
|
select * from t1 force index(c) order by c; |
|
|
|
a b c d |
|
|
|
11 11 aaa mmm |
|
|
|
1 1 ab ab |
|
|
|
@ -685,7 +556,7 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
10 10 kkk iii |
|
|
|
select * from t1 order by d; |
|
|
|
select * from t1 force index(d) order by d; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -694,15 +565,15 @@ a b c d |
|
|
|
8 9 fff fff |
|
|
|
10 10 kkk iii |
|
|
|
11 11 aaa mmm |
|
|
|
explain select * from t1 order by b; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
1 SIMPLE t1 index NULL b 5 NULL 7 |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
1 SIMPLE t1 index NULL c 31 NULL 7 |
|
|
|
explain select * from t1 force index(d) order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 7 Using filesort |
|
|
|
1 SIMPLE t1 index NULL d 63 NULL 7 |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -743,36 +614,16 @@ a b c d |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by c; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by d; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
explain select * from t1 order by b; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 5 Using filesort |
|
|
|
1 SIMPLE t1 index NULL b 5 NULL 5 |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -793,7 +644,7 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
10 10 aaa kkk |
|
|
|
select * from t1 order by b; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -801,7 +652,7 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
10 10 aaa kkk |
|
|
|
select * from t1 order by c; |
|
|
|
select * from t1 force index(c) order by c; |
|
|
|
a b c d |
|
|
|
10 10 aaa kkk |
|
|
|
1 1 ab ab |
|
|
|
@ -809,7 +660,7 @@ a b c d |
|
|
|
3 2 ad ad |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
select * from t1 order by d; |
|
|
|
select * from t1 force index(d) order by d; |
|
|
|
a b c d |
|
|
|
1 1 ab ab |
|
|
|
2 2 ac ac |
|
|
|
@ -817,15 +668,15 @@ a b c d |
|
|
|
4 4 afe afe |
|
|
|
8 9 fff fff |
|
|
|
10 10 aaa kkk |
|
|
|
explain select * from t1 order by b; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
explain select * from t1 order by c; |
|
|
|
1 SIMPLE t1 index NULL b 5 NULL 6 |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
explain select * from t1 order by d; |
|
|
|
1 SIMPLE t1 index NULL c 21 NULL 6 |
|
|
|
explain select * from t1 force index(d) order by d; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort |
|
|
|
1 SIMPLE t1 index NULL d 43 NULL 6 |
|
|
|
show create table t1; |
|
|
|
Table Create Table |
|
|
|
t1 CREATE TABLE `t1` ( |
|
|
|
@ -912,15 +763,15 @@ t1 CREATE TABLE `t1` ( |
|
|
|
check table t1; |
|
|
|
Table Op Msg_type Msg_text |
|
|
|
test.t1 check status OK |
|
|
|
explain select * from t1 order by c; |
|
|
|
explain select * from t1 force index(c) order by c; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort |
|
|
|
1 SIMPLE t1 index NULL c 5 NULL 9 |
|
|
|
explain select * from t1 order by a; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 index NULL PRIMARY 4 NULL 9 |
|
|
|
explain select * from t1 order by b; |
|
|
|
explain select * from t1 force index(b) order by b; |
|
|
|
id select_type table type possible_keys key key_len ref rows Extra |
|
|
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 9 Using filesort |
|
|
|
1 SIMPLE t1 index NULL b 4 NULL 9 |
|
|
|
select * from t1 order by a; |
|
|
|
a b c |
|
|
|
1 5 1 |
|
|
|
@ -932,7 +783,7 @@ a b c |
|
|
|
11 19 19 |
|
|
|
12 18 18 |
|
|
|
13 17 17 |
|
|
|
select * from t1 order by b; |
|
|
|
select * from t1 force index(b) order by b; |
|
|
|
a b c |
|
|
|
5 1 5 |
|
|
|
4 2 4 |
|
|
|
@ -943,7 +794,7 @@ a b c |
|
|
|
12 18 18 |
|
|
|
11 19 19 |
|
|
|
10 20 20 |
|
|
|
select * from t1 order by c; |
|
|
|
select * from t1 force index(c) order by c; |
|
|
|
a b c |
|
|
|
1 5 1 |
|
|
|
2 4 2 |
|
|
|
|