Saturday, 14 September 2013

Break mysql row examination with primary key

Break mysql row examination with primary key

id int(primary key , unique)
status enum('enable','disable')
round tinyint(1) (index)
core tinyint(1) (index)
timestamp int(10) (index)
I got a query in a table about 1,800,000 rows.
there's a query like
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
Row examination of the query is about 1,680,000 rows
So, i added a id > 1600000 statement to the query , so it looks like
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
yet row examinations is the same.
is there anyway to break row examination?

No comments:

Post a Comment