Hey

Does anyone have some optimization tips for this query:

SELECT count(id) FROM tblTabel WHERE fieldName != '' AND
DATE_FORMAT(myDateField,'%Y%m%d') = 20011120;

It does not use the index i have created, so it scans the entire table,
which is a bit to slow.

The problem off course is, that MySQL has to do a calculation on the
myDateField before it can decide if the row matches. Any "workarounds" for
this?

Mvh Emil
--
Emil Rasmussen
http://noget.net


---------------------------------------------------------------------
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

Reply via email to