前辈们好,有个问题想请教下前辈们平时查询不是很常用到Order By 时间字段的吗可是这个时间字段,比如是更新时间,Order By UpdateTime就算给UpdateTime加索引了貌似也没效果额
查询语句:SELECT * FROM order ORDER BY UpdateTime;
其实也不是不生效,如果我在Order By 前面加上Where UpdateTime >=就会触发索引
但是时间一旦稍微放宽点,又会FileSort了……
认证0级讲师
SELECT *,UpdateTime FROM order ORDER BY UpdateTime;
The index field should appear in the WHERE condition.
SELECT *,UpdateTime FROM order ORDER BY UpdateTime;
The index field should appear in the WHERE condition.