Re: key on the month portion of a date field

2005-02-09 Thread Greg Fortune
Remember, a low cardinality index will possibly be ignored by the optimizer and an index on month will never have a cardinality of more than 12. For testing purposes, you might try added a column for month and populating it off your current data. update the_table set the_field=MONTH(the_field)

Re: key on the month portion of a date field

2005-02-09 Thread Gary Richardson
On Wed, 9 Feb 2005 15:17:36 -0200, Gabriel B. <[EMAIL PROTECTED]> wrote: > It is not too slow this way since i started the WHERE with lots of > checks that cuts down to a medium of 200 rows that actualy gets to > this check, but i feel uncorfotable to not use a index. Isn't there a limit of 1 ind

Re: key on the month portion of a date field

2005-02-09 Thread Paul DuBois
At 15:37 -0200 2/9/05, Gabriel B. wrote: On Wed, 09 Feb 2005 17:24:10 +, love <[EMAIL PROTECTED]> wrote: alter table table_name add index (birthday); But would that index improve this kind of query? the docs talk about only direct matchs, like "birthday < now()" or" birthday between x and y"

Re: key on the month portion of a date field

2005-02-09 Thread Gabriel B.
On Wed, 09 Feb 2005 17:24:10 +, love <[EMAIL PROTECTED]> wrote: > alter table table_name add index (birthday); But would that index improve this kind of query? the docs talk about only direct matchs, like "birthday < now()" or" birthday between x and y". They're all full date values. -- My

Re: key on the month portion of a date field

2005-02-09 Thread love
use below: alter table table_name add index (birthday); Love Kumar .. [EMAIL PROTECTED] wrote: Short Version: is there any way to make an index for a date field that appears in the WHERE as a MONTH() argument? I have a table with some hundreds of thousands of rows already, and now i have the need t

key on the month portion of a date field

2005-02-09 Thread Gabriel B.
Short Version: is there any way to make an index for a date field that appears in the WHERE as a MONTH() argument? I have a table with some hundreds of thousands of rows already, and now i have the need to show upcoming birthdays to some users. the query uses WHERE MONTH(birthday).. the `birthda