percona mysql5.5.29 index on timestamp will not use
I have a table defination like this:
CREATE TABLE `t_pearl_
`fin_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`partner_id` int(11) NOT NULL,
`createtime` timestamp NULL,
PRIMARY KEY (`fin_id`),
KEY `createtime` (`createtime`),
KEY `partner_id_2` (`partner_
) ENGINE=InnoDB AUTO_INCREMENT=
mysql> explain select * from t_pearl_
*******
id: 1
select_type: SIMPLE
table: t_pearl_
type: range
possible_keys: createtime
key: createtime
key_len: 5
ref: NULL
rows: 3504312
Extra: Using where
1 row in set (0.00 sec)
mysql> explain select * from t_pearl_
*******
id: 1
select_type: SIMPLE
table: t_pearl_
type: ALL
possible_keys: createtime
key: NULL
key_len: NULL
ref: NULL
rows: 9220001
Extra: Using where
1 row in set (0.00 sec)
mysql> explain select * from t_pearl_
*******
id: 1
select_type: SIMPLE
table: t_pearl_
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 8732399
Extra: Using where
1 row in set (0.00 sec)
mysql> explain select * from t_pearl_
*******
id: 1
select_type: SIMPLE
table: t_pearl_
type: ALL
possible_keys: NULL
key: NULL
key_len: NULL
ref: NULL
rows: 8732539
Extra: Using where
1 row in set (0.00 sec)
I wonder why above sql will not use the 'createtime' index?
Question information
- Language:
- English Edit question
- Status:
- Solved
- Assignee:
- No assignee Edit question
- Solved by:
- Alexey Kopytov
- Solved:
- Last query:
- Last reply: