Skip navigation links

MySQL Forums :: Performance :: Long execution time despite LIMIT 3


Advanced Search

Re: Long execution time despite LIMIT 3
Posted by: Joachim Berger ()
Date: June 21, 2011 02:06AM

It somehow seems I might be getting there:


I could rewrite the SELECT as follows:

(SELECT m.*, m.flags + 0 flags
FROM messages_test m
WHERE (m.thread = 817549.001266066) AND (id_user_s = 817549) AND (del_s = 0))

UNION

(SELECT m.*, m.flags + 0 flags
FROM messages_test m
WHERE (m.thread = 817549.001266066) AND (id_user_r = 817549) AND (del_r = 0))

order by id desc
LIMIT 3;


and have indexes like:
test1 (thread,id_user_r,del_r)
test2 (thread,id_user_s,del_s)


What do you think?

Options: ReplyQuote


Subject Views Written By Posted
Long execution time despite LIMIT 3 1129 Joachim Berger 06/19/2011 12:47PM
Re: Long execution time despite LIMIT 3 482 Joachim Berger 06/19/2011 12:54PM
Re: Long execution time despite LIMIT 3 461 Rick James 06/20/2011 06:33PM
Re: Long execution time despite LIMIT 3 447 Joachim Berger 06/20/2011 11:44PM
Re: Long execution time despite LIMIT 3 469 Joachim Berger 06/21/2011 02:06AM
Re: Long execution time despite LIMIT 3 474 Rick James 06/21/2011 07:23AM
Re: Long execution time despite LIMIT 3 415 Joachim Berger 06/21/2011 07:28AM
Re: Long execution time despite LIMIT 3 498 Joachim Berger 06/21/2011 10:33AM
Re: Long execution time despite LIMIT 3 547 Rick James 06/21/2011 10:08PM
Re: Long execution time despite LIMIT 3 642 Joachim Berger 06/22/2011 12:33AM
Re: Long execution time despite LIMIT 3 500 Rick James 06/22/2011 07:26PM
Re: Long execution time despite LIMIT 3 450 Joachim Berger 06/22/2011 11:45PM
Re: Long execution time despite LIMIT 3 412 Rick James 06/23/2011 08:53AM
Re: Long execution time despite LIMIT 3 524 Joachim Berger 06/24/2011 02:51AM


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.