List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:July 29 1999 8:08pm
Subject:Re: Dates and inexes
View as plain text  
>>>>> "Chris" == Chris Trown <ctrown@stripped>
> writes:


Chris>     In my little test DB, I have at least 40,000 rows.

>> MySQL can use index on datetime, but NEVER in a function. As soon as
>> you use a function on any datatype, no index is used.q

Chris>       I suspected as much with functions.

Chris>       Ok, so what would be the best approach if I need to search on a
Chris> particular year/month combo?  Would something like

Chris> select login, start_time from foobar where start_time='1999-07'


The following will use index on start_time

select login, start_time from foobar where start_time between
'1999-07-01 00:00:00' and '1999-07-31 23:59:59';

Dates and inexesChris Trown14 Jul
  • Dates and inexessinisa14 Jul
    • Re: Dates and inexesChris Trown14 Jul
      • Re: Dates and inexessinisa15 Jul
      • Re: Dates and inexesMichael Widenius30 Jul
  • Re: Dates and inexesPaul DuBois14 Jul