mysql的group by比较慢怎么办?
例如:SELECT ip,createtime FROM sys_log GROUP BY ip,createtime
解决方法:
默认情况下,MySQL对所有GROUP BY col1,col2…的字段进行排序。如果查询包括GROUP BY,想要避免排序结果的消耗,则可以指定ORDER BY NULL禁止排序。
修改为:SELECT ip,createtime FROM sys_log GROUP BY ip,createtime ORDER BY NULL
本文地址:http://www.yayihouse.com/yayishuwu/chapter/1330
向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti