mysql> explain select * from queryLog where date_format(queryTime, '%Y-%m-%d') =
'2004-11-16';
+----------+------+---------------+------+---------+------+------+-------------+



| table | type | possible_keys | key | key_len | ref | rows | Extra |


+----------+------+---------------+------+---------+------+------+-------------+


| queryLog | ALL | NULL | NULL | NULL | NULL | 245 | Using where |


+----------+------+---------------+------+---------+------+------+-------------+


1 row in set (0.01 sec)

mysql> explain select * from queryLog where queryTime = date_format('2004-11-16'
, '%Y-%m-%d');
+----------+------+-------------------+-------------------+---------+-------+---


---+-------------+
| table | type | possible_keys | key | key_len | ref | ro
ws | Extra |
+----------+------+-------------------+-------------------+---------+-------+---


---+-------------+
| queryLog | ref | idx_querytime_log | idx_querytime_log | 4 | const |
1 | Using where |
+----------+------+-------------------+-------------------+---------+-------+---


---+-------------+
1 row in set (0.00 sec)


Jeff Smelser wrote:

On Tuesday 07 December 2004 02:03 pm, Victor Pendleton wrote:
> A function on the left hand side will nullify the use of an index.

Sides dont matter, a function on an index, no matter what side, will kill an
index.


Jeff

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to