Does it make sense to ever index a DATETIME column? We do a
lot of reporting on a large (~10MM records) table where we
only need to look at a particular day or two. My selects
currently look like:

WHERE entered >= 20040124000000 AND entered <= 20040124235959

Is there such a thing as an index on the first 8 characters
of a DATETIME column? And if so, how do I reconstruct the
WHERE to use it? Would this work:

WHERE SUBSTRING(entered, 1, 8) = 20040124

? I couldn't find any relevant info in the purple book.

____________________________________________________________
Eamon Daly
NextWave Media Group LLC
Tel: 1 773 975-1115
Fax: 1 773 913-0970

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

Reply via email to