0

考虑:

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

然而,行考试是一样的。有没有办法打破排考?

4

0 回答 0