用主键打破MySQL行检查

时间:2013-09-14 12:07:15

标签: mysql sql database

考虑:

id int(primary key , unique)   
status enum('enable','disable')   
round tinyint(1) (index)  
core tinyint(1) (index)  
timestamp int(10) (index)

我在表中查询了大约1,800,000行。有一个类似的查询:

SELECT *  
FROM  tblmatch 
WHERE status = 'disable' 
  and round=0 
  AND core = 3 
  AND time_stamp < UNIX_TIMESTAMP() 
ORDER BY time_stamp ASC 
LIMIT 0,10

查询的行检查大约是1,680,000行。

所以,我在查询中添加了id > 1600000条件,所以它看起来像:

SELECT * 
FROM tblmatch 
WHERE id > 1600000 
  AND status = 'disable' 
  and round=0 
  AND time_stamp < UNIX_TIMESTAMP() 
ORDER BY time_stamp ASC 
LIMIT 0,10

然而,行检查是一样的。有没有办法打破行检查?

0 个答案:

没有答案