>>>>> "MW" == Michael Widenius <monty@stripped> writes:
MW> What may confuse someone is that the simple operators: >=, >, = , <
MW> and <= does some 'extra magic' when one compares a 'date/datetime/time
MW> type' column to a constant strings to make date handling easier. We
MW> didn't add this behaviour to the BETWEEN clause as it's harder to make
MW> a simple rule when one have 3 arguments to take care compared to two
MW> arguments.
So, when one wants to do a "between" with dates, which is the
preferred form? Below, date_value is a column of type DATE.
a)
where date_value BETWEEN '1999-05-01' AND '1999-05-31'
b)
where date_value <= '1999-05-31' AND date_value >= '1999-05-01'
Which one does the faster compares? Why not just have the parser
internally rewrite form (a) as (b) then apply the necessary rules for
optimizing date/time compares?
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D. Khera Communications, Inc.
Internet: khera@stripped Rockville, MD +1-301-545-6996
PGP & MIME spoken here http://www.kciLink.com/home/khera/