在(尤其是)以下mysql中进行查询时,是否有更好的性能:
SELECT * FROM `table` WHERE `unix_date` BETWEEN 1291736700 AND 1291737300
过度:
SELECT * FROM `table` WHERE `unix_date` >= 1291736700 AND `unix_date` <= 1291737300
或BETWEEN语法仅被第二个sql替代?
我记得,没有区别。但是,请自己看看是否:
explain plan for SELECT * FROM `table` WHERE `unix_date` BETWEEN 1291736700 AND 1291737300
和:
explain plan for SELECT * FROM `table` WHERE `unix_date` >= 1291736700 AND `unix_date` <= 1291737300
制定相同的计划。