How to get a random database row from a large result set.
Use random offset (see comments)
use php random() function on sumary table
Josh Berkus' Random Aggregate
use a column of randomly assigned INT's
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
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