同时posttime如果是创建时间的话且ID也是自增,根据ID排序就相当于posttime排序,不过影响不大
8万条数据其实没多少,不用太担心
alter table xx_news add index index_1(checkinfo, delstate)
1、SELECT id,classid,linkurl,title,picurl,description FROM `xx_news` WHERE checkinfo=true AND delstate='' ORDER BY id DESC LIMIT 0,6
2、SELECT id,classid,linkurl,title FROM `xx_news` WHERE checkinfo=true AND delstate='' AND flag LIKE '%h%' ORDER BY posttime DESC LIMIT 0,10
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)