On my front page, I have it pull the last unique forum posts. For some reason, it takes a moment to load this section of the page so I think it may be inefficient due to the size of my forums. I don't want to prune my forums just yet because they're really not all that large.
So my question is, is there a way to speed up this query?
, (CASE WHEN (b.subject = '') THEN (c.subject) ELSE (b.subject) END) AS subject
, DATE_FORMAT(FROM_UNIXTIME(b.postdate), '%M %e %Y ') AS postdate
FROM deluxebb_posts b
INNER JOIN deluxebb_users a ON b.author = a.uid
INNER JOIN deluxebb_threads c ON (b.tid = c.tid AND c.fid != 14)
LEFT JOIN deluxebb_posts d ON d.tid=c.tid AND b.pid < d.pid
WHERE d.pid IS NULL
ORDER BY b.pid DESC
LIMIT 0,6;") or die(mysql_error());