时间范围查询优化技巧

1 对datetime和timestamp建索引

2 查询语句强制使用索引 SELECT * from task FORCE INDEX(unique_key_taskno) where TASK_NO = 'FZ202008140051'

3 尽量使用between and 而不是大于 小于

4 如果能把日期转换为long型那是最好的

原文地址:https://www.cnblogs.com/juniorMa/p/13997923.html