Unfortunately those ideas were already covered. Looks like my only option is to SELECT COUNT and then let perl select a random ID from the database. (/me frowns over the wasted transit time)
My code doesn't have bugs, it just develops random features.