MySQL Forums
Forum List  »  Performance

Re: Sudden drop in performance on MyISAM DB
Posted by: Rick James
Date: October 17, 2012 09:41PM

explain 
select  message_id
    from  email_message em, message m
    where  m.id=em.message_id
      and  m.sent_on is null    -- Missing from proposed index
      and  m.publisher_id=2     -- In index
    order by  m.created_on      -- Last in index
ALTER TABLE message ADD INDEX(publisher_id, created_on);

Jørgen, I am weak on this subtle issue...
Can you elaborate on when this pattern works and when it might not? I see that part of the index is being used for the WHERE filtering, but then it skips over to the ORDER BY.
Also (if you happen to know), I would like to know how far back in old versions this index would actually use both fields.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Sudden drop in performance on MyISAM DB
880
October 17, 2012 09:41PM


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.