On Tuesday 07 December 2004 02:51 pm, you wrote:
> mysql> explain select * from queryLog where date_format(queryTime, > '%Y-%m-%d') = > '2004-11-16'; > mysql> explain select * from queryLog where queryTime = > date_format('2004-11-16' > , '%Y-%m-%d'); > +----------+------+-------------------+-------------------+---------+------ We are not talking about the same thing.. Your assuming the right side is a variable and it may not be.. Try: explain select * from queryLog where '2004-11-16' = date_format(queryTime, '%Y-%m-%d'); Thats also the on the right side.. select * from date1, date2 where date1.date = date2.date; The above query, no matter which side you use a function on, will cause the index to be thrown.. Jeff
pgpCPAUJk2r7Y.pgp
Description: PGP signature