The problem with server speed is this:
http://www.dead-donkey.com/modules/news ... php?id=211
I've been trying to get our host to move us to a better box for weeks now, but i get the feeling either the guy who's supposed to do it is on holiday or he's busy. The speed issue is server imo, not software.
BTW, I don't write the board code
www.phpbb.com
I modify it heavily, the frontpage is all mine, the header, etc. but the board and the way it displays topics/forums/posts, etc aren't mine. Most optimisations they have already done.
You're not doing page by page jumps or "do while" loop, are you? Cuz even though I'm not all that familiar with MySQL (I'm guessing that's what this site is on:?) most DBs have either JumpTo or JumpBy (or both) and you could calculate how far it should jump with page number or post number as a parameter. Just a thought.... Cheers!
Are you up on modern SQL servers? They do all the optimisation in atomic steps at a lower level, so your sql can be written a million ways, but the optimiser always executes it in the quickest possible way. You may be really crap at SQL but the SQL server saves you and actually translates it into the best form before actually commiting. There's times it will be slower, which are patched as the mysql server software gets better, but its generally 'fixed' on the fly for you
There's nothing like a while loop in mysql, that's programmatical.
I believe the query for threads uses a LIMIT BY from, to, to restrict results