Robust
Well-known member
The following query takes around 4.5 seconds to run on a big board apparently. It's used to fetch data for a profile tab, it's loaded deferred of course, but 4.5 seconds is a while. How can I optimise it?
Code:
SELECT post.*, thread.title, thread.thread_id, thread.bestanswer FROM xf_post AS post
LEFT JOIN xf_thread AS thread
ON (thread.thread_id = post.thread_id)
WHERE post.user_id = ?
AND post.ba_votes >= 1
ORDER BY post.post_date DESC
LIMIT 10