MySQL Forums
Forum List  »  Optimizer & Parser

Re: MySQL 5.1 does not seem to be using the index that I expect it to.
Posted by: Tom Muldoon
Date: April 03, 2011 05:40PM

Hi RIck,

your assumptions regarding the query are correct. With that said, I tried the query per your suggestion...

select id, trigger_time, note, type, status,
notification_status, submission_id,
actor_id, actor_display_name, actor_user_type,
recipient_id, recipient_display_name,
recipient_user_type, system_id,
from activity_event
where recipient_id=1
order by trigger_time ASC, id ASC;

... and here's the explain plan (it does not use the expected index)...

'1', 'SIMPLE', 'activity_event', 'ref', 'recipient_id__status__trigger_time__id,recipient_id__trigger_time__id', 'recipient_id__status__trigger_time__id', '8', 'const', '333', 'Using where; Using filesort'

I'm afraid that I don't know what you mean by "(Use [ code ] before, and [ /code ] after (without spaces).)".


Options: ReplyQuote

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.