At 15:37 -0200 2/9/05, Gabriel B. wrote:
On Wed, 09 Feb 2005 17:24:10 +0000, 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.

It won't help except for queries that test the value of birthday directly. As soon as you use the column in a calculation such as a function call, the index can't be used.

To use month in indexed fashion, you could store dates as separate
year, month, and date columns.  But that might be more of a hassle
than you want to deal with.

--
Paul DuBois, MySQL Documentation Team
Madison, Wisconsin, USA
MySQL AB, www.mysql.com

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



Reply via email to