Fixed a heavy sql query in the forum