select xxx from xx where date_create > 'xx' and date_create < 'xx'; -- 总数据量约 100w
此时加入分页参数
select xxx from xx where date_create > 'xx' and date_create < 'xx' limit index,1000
现在发现,当 index 大于 30w 的时候,查询速度直线下降[小于 30w 的时候,只要 1 秒,大于 30 万,需要 40 多秒],似乎以 30 万为分界点?
explain 看了下,走上的索引都是 date_create
求教下,这是什么原因导致查询差距巨大呢?
是 mysql 认为 limit 的起点过大?不如全表扫描?