login | register
Wed 17 of Mar, 2010 (20:19 UTC)

bitweaver - Web Application Framework and CMS

Web Application Framework and CMS

Refresh cacheRSS feedPrint

How to get a random database row from a large result set.

by spiderr
Saturday 05 of May, 2007
Use random offset (see comments)

use php random() function on sumary table

Josh Berkus' Random Aggregate

use a column of randomly assigned INT's

There is some discussion of selecting random rows in the list archives.
My recollection is that we decided the only way to be fast *and*
truly random was to dedicate an extra column to be a random key.

regards, tom lane


Comments