Topic: Search - Recent Posts

Our Recent Posts search is slow as shown: Generated in 4.076 seconds, 4 queries executed

Is this search affected by the number of posts?

Re: Search - Recent Posts

Is this on MySQL or another DBMS?
Oh, and enable PUN_SHOW_QUERIES and post the slow query.

3 (edited by qubertman 2008-02-08 17:28)

Re: Search - Recent Posts

MySQL 5.0.45

Time: 4.02459

SELECT t.id AS tid, t.poster, t.subject, t.last_post, t.last_post_id, t.last_poster, t.num_replies, t.closed, t.forum_id, f.forum_name FROM punbb_topics AS t INNER JOIN punbb_posts AS p ON p.topic_id=t.id INNER JOIN punbb_forums AS f ON f.id=t.forum_id LEFT JOIN punbb_forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=2) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND p.posted>1202405009 AND t.moved_to IS NULL GROUP BY t.id ORDER BY t.last_post DESC

Re: Search - Recent Posts

Hmm, I wonder if there's a reason we're joining the posts table in...

Re: Search - Recent Posts

There doesn't seem to be any reason to join in the posts table, as the last post time is stored in the topic table anyway.

Re: Search - Recent Posts

That's what I'm thinking

Re: Search - Recent Posts

I noticed Smartys committed a fix for this. Did it help qubertman?

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Search - Recent Posts

Yes. Thank you!