What's mysql's “BETWEEN” performance over..?

后端 未结 4 1064
一生所求
一生所求 2020-12-03 06:38

Is there any better performance when querying in (particularly) mysql of the following:

SELECT * FROM `table` WHERE `unix_date` BETWEEN 1291736700 AND 129173         


        
4条回答
  •  日久生厌
    2020-12-03 07:03

    As I recall, there's no difference. But see for yourself if:

    explain plan for 
    SELECT * FROM `table` WHERE `unix_date` BETWEEN 1291736700 AND 1291737300
    

    and:

    explain plan for
    SELECT * FROM `table` WHERE `unix_date` >= 1291736700 AND `unix_date` <= 1291737300
    

    produce the same plans.

提交回复
热议问题