标签归档:慢查询

奇异的慢查询,MYSQL慢查询之坑

这是个慢查询

SELECT *, `user_id` as uid
FROM (`journals`)
WHERE `user_id` IN ('1456870', 2573141) 
AND `status` =  1
ORDER BY `id` desc
LIMIT 20

这个则不是

SELECT *, `user_id` as uid
FROM (`journals`)
WHERE `user_id` IN (1456870, 2573141) 
AND `status` =  1
ORDER BY `id` desc
LIMIT 20