Re: Efficient date range search?

From: Jonathan Leffler <jleffler_at_earthlink.net>
Date: Wed, 09 Oct 2002 05:00:52 GMT
Message-ID: <3DA3B7D8.30407_at_earthlink.net>


Dieter Nöth wrote:

> Jonathan Leffler wrote:
>

>>Then the criterion for 'alive at time 2001-07-04 19:30:00' is:
>>
>>WHERE born <= TIMESTAMP '2001-07-04 19:30:00'
>>   AND died >= TIMESTAMP '2001-07-04 19:30:00'

>
> why not
> TIMESTAMP '2001-07-04 19:30:00' BETWEEN born AND died

No reason except I've never looked at it that way round; I'm used to thinking of "variable BETWEEN constant1 AND constant2" - inertia, in other words. I doubt if it makes any difference whatsoever to the execution plan which of the two is written.

-- 
Jonathan Leffler                   #include <disclaimer.h>
Email: jleffler_at_earthlink.net, jleffler_at_us.ibm.com
Guardian of DBD::Informix 1.00.PC2 -- http://dbi.perl.org/
Received on Wed Oct 09 2002 - 07:00:52 CEST

Original text of this message