1.问题分析
这个查询要5万多秒
select * from pp_phoenixplan_ebay_queue where ID > 695302464 -- PRIMARY
select count(0) from pp_phoenixplan_ebay_queue -- 108470169
2.解决方案
优化方案:
1.使用的是PRIMARY,不用order BY ,速度会快很多;
2.表数据1亿,select * 改为查询具体使用的字段;
3.pp_phoenixplan_ebay_queue 这个看着是队列表,执行成功的数据是否可以清理
3.慢sql
select * from pp_phoenixplan_ebay_queue where ID > 695302464 order BY ID asc