总结来说就一下几点。
1. 当类似这种的时候,select * from a where a.id = XXXX order by a.b;建立联合索引。当where是范围的时候不走索引的,即使建立了联合索引。具体情况可以用explain分析,看最后的Extra属性是否出现use filesort.
2.group by和上面类似。
TRANSLATE with x English TRANSLATE with COPY THE URL BELOW Back EMBED THE SNIPPET BELOW IN YOUR SITE Enable collaborative features and customize widget: Bing Webmaster Portal Back 标签:group,where,索引,location,document,优化,order From: https://www.cnblogs.com/andrewlovemeimei/p/16826235.html