MySQL Forums
Forum List  »  Optimizer & Parser

avoid filesort
Posted by: Magnus Larsson
Date: January 22, 2012 01:08PM

How can i avoid filesort in this query?

SELECT
f_thread.id,f_thread.subject,
(
SELECT
MAX(postdate)
FROM
f_post
WHERE
f_post.thread_id = f_thread.id
LIMIT 1
) AS last_post
FROM
f_thread ORDER BY last_post DESC LIMIT 25

Best Regards

Options: ReplyQuote


Subject
Views
Written By
Posted
avoid filesort
1575
January 22, 2012 01:08PM
944
January 24, 2012 01:17AM
1047
January 24, 2012 04:36PM
1150
January 25, 2012 07:24PM
995
January 26, 2012 04:57AM
981
January 25, 2012 08:26PM
961
January 26, 2012 04:56AM


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.