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: Rick James
Date: April 03, 2011 05:01PM

I assume you are referring to
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
## without this:      and  status=1
    order by  trigger_time desc, id desc;   -- Still with DESC on both??

What do you get for this?
EXPLAIN
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;
(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.