What I do for random photo and book on my site (
http://mark.aufflick.com/) to minimise db hits on the front page is to util_memoize a list of photo (or book) id's, and then pick one at random in tcl.
Sure the list is pretty darn long, but not really a lot of data (they're just integers) and every db hit you save on your front page is worth it.
I stole this idea (and some of the code) from Lars' old photo and book packages he hacked for his old website. You can download my diffs from his code on my website (http://mark.aufflick.com/about) but I don't think you can download Lars' old modules from CVS any more. The new ones are much better anyway.
If you want, I can post the tcl/sql snippets that do the work.