在我的测试表中有 100 万行,列 id 是从 1 到 100 万自动生成的数字,id 列是唯一索引,timestore 列存储插入时间,当在 id 范围之间执行选择查询时:
select * from test where id > 345673 and id < 453267
执行时间 - 0.379s
如果在两个日期之间执行选择查询
select * from test where timestore between '2014-12-28 16:59:50' and '2014-12-28 17:1:50'
执行时间 - 1.478s
为什么第二个查询比第一个多?