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 to show upcoming birthdays to some users.

the query uses WHERE MONTH(birthday).. the `birthday` field is of date
(0000-00-00) type

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.

So, is there any way to make an index for that kind of query, or i
must re-estruct the table to have a month field?

Thanks!
Gabriel

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



The information transmitted is intended only for the person or entity to whom it is addressed and may contain confidential and / or privileged Material. Any review, re-transmission, dissemination or other use of or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from your computer. Thank you for your understanding & co-operation.






Reply via email to