Hi List,
I sure do appreciate this list.
I'm stumped on the following query:
SELECT
head.po
FROM
head
LEFT JOIN line ON (head.sn=line.snHead)
WHERE
head.po > 1
AND line.dateETA<='2002-06-10'
LIMIT 50
As is, this query is very fast (0.01 seconds when there are 25,000 records
in 'head', and 50,000 records in 'line'). However, when I change the query
to search on line.dateETA ">=" or even "=" [somedate], the query takes a
long time to return (2-3 seconds).
The line.dateETA field is indexed. And, for both "<=" and ">=" queries,
EXPLAIN returns the same information.
The only thing I can think of is that NULL values are allowed in
line.dateETA, and about half the values are NULL (22,000 lines). However,
I tested changing the line.dateETA field to NOT NULL, and I didn't get any
better performance.
Is there a known speed issue in searching on date fields with "<=" versus ">="?
Thanks,
Matt
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php