遇到一个Mysql的bug:
如下语句1:
select * from table1 where xxxxxx order by field1 asc
执行耗时若干毫秒
但是 语句2:
select * from table1 where xxxxxx order by field1 asc limit 15
却需要耗时4秒多
最终结论应该是mysql的bug,因为从SQL语法上这个逻辑没有问题
解决方案,采用子查询
select * from (select * from table1 where xxxxxx order by field1 asc) limit 15