List:General Discussion« Previous MessageNext Message »
From:Chris Trown Date:July 14 1999 12:23am
Subject:Dates and inexes
View as plain text  

     Today is the day for questions.

     Given:

mysql> show columns from foobar;

+------------+----------+------+-----+---------------------+-------+
| Field      | Type     | Null | Key | Default             | Extra |
+------------+----------+------+-----+---------------------+-------+
| login      | char(40) |      | MUL |                     |       |
| start_time | datetime |      | MUL | 0000-00-00 00:00:00 |       |
| stop_time  | datetime |      | MUL | 0000-00-00 00:00:00 |       |
+------------+----------+------+-----+---------------------+-------+
3 rows in set (0.01 sec)

     Is there any way to make month() function go faster?  For example:

select login, start_time from foobar where login='ctrown' and month(start_time)=7;

     shows no index when I use EXPLAIN.  For that matter, does MySQL make use
of indexs on datetime types?

Chris...

-- 
PGP fingerprint: 063FCE320681C336  78C164FC9B2F91EA
Thread
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