I think i'd use a LIMIT on the select for topics.
Now expand on this to make it server friendly. Write the results to a file. Check the timestamp of the file. If it's younger than 5 minutes old server the content right off the file instead of doing the database hit. If the file is older than 5 minutes unlink it, do the database work, write the file, then server it.