查询时间加大,索引不生效
当查询为:
explain select mail from client_login_logs where create_time>='2017-10-11' and create_time<='2017-10-21' and device_type=5 and mail!=''
结果为:
当查询的日期增加一天,如下:
explain select mail from client_login_logs where create_time>='2017-10-11' and create_time<='2017-10-22' and device_type=5 and mail!=''
结果为
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
idx_cdate_dtype_staus 这个索引列存在空值。
建议加上cdate_dtype_staus!=null
理论上mysql自己会选择成本最低的执行计划,如果人工确认使用索引更合适,可以通过hints强制使用索引