Re: what is forum_id?
What version are you using? There were some performance improvements, including adding indexes, but it would depend on your version.
Also, rather than hacking your installation, please consider filing a trac ticket to be sure the fix is evaluated and implemented for everyone.