List:General Discussion« Previous MessageNext Message »
From:Hank Eskin Date:May 11 1999 1:53am
Subject:Simple Indexing Question...
View as plain text  
Easy question:

  I have a datetime column in a table of 150,000 rows,
and I want to query records for a certain day AND use
the index on the column.. Anytime I do this:

SELECT * FROM tables where TO_DAYS(NOW()) = TO_DAYS(entry_time) ;  <today's
records>
Or
SELECT * FROM tables where TO_DAYS(entry_time) = 730249; 
     <records for some other day, using from_days() function)>

The explain does not use the index on entry_time, and I don't want to add
another column just for day number..

Thanks in advance!

-Hank

Thread
Simple Indexing Question...Hank Eskin11 May
  • Re: Simple Indexing Question...Sasha Pachev11 May