Can I put an mysql index on a date field with when I use >= or <=?

Posted by Ryan Detzel on Stack Overflow See other posts from Stack Overflow or by Ryan Detzel
Published on 2010-06-15T21:00:54Z Indexed on 2010/06/15 21:02 UTC
Read the original article Hit count: 213

Filed under:
|

I have indexes for my table user,date, and date,user but when I issue queries like

SELECT * FROM table WHERE date >= '2010-5-1' and user='test';

It doesn't use the date,user index it uses the user index. Is there any way to get mysql to use the date,user index for these queries?

© Stack Overflow or respective owner

Related posts about mysql

Related posts about index