No idea how it works in MySQL, it doesn't look like valid SQL. Attached is a patch that rationalises JOIN/joincondition order in advanced_forum_unread_posts_in_forum, that works on postgresql 8.1. I haven't tested it in MySQL.

Comments

michelle’s picture

Title: Unread posts query broken in PostgreSQL » Unread posts query broken
Priority: Normal » Critical
Status: Needs review » Active

I applied your patch and that may make it not error on postgres but, unfortunately, it doesn't make it actually work. I think I dropped the ball on this one and didn't test it well or, honestly, at all considering it's totally broken. This needs to get fixed before I can do an alpha.

Thanks for catching it,

Michelle

michelle’s picture

Status: Active » Fixed

Ok, with some help from merlinofchaos, I've rewritten this query. No idea if it works on postgres, sorry, since rewriting it invalidated this patch.

I also changed the setting to have this off by default as the query is really a killer on large forums. On my D5 site with a small number of posts it was fine. On my D6 site with > 100K posts, it totally killed it.

Michelle

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.