sql优化

原语句:SELECT id, catid, title, keywords, description, inputtime
FROM news
WHERE catid = 5827117610
ORDER BY id DESC LIMIT 1250, 50
优化后:SELECT id, catid, title, keywords, description, inputtime
FROM news
inner join (select id
               from news
              where catid = 5827117610
              ORDER BY id DESC LIMIT 1250, 50) as lim
 using (id);

posted on 2015-09-15 14:20  逍遥郭  阅读(122)  评论(0编辑  收藏  举报

导航