"gnari" <gnari(at)simnet(dot)is> writes:
> Tthe problem with this is that this is not very random.
> If the uids 30000 to 39999 have been missing, but
> the uids are more or less contiguous apart from that,
> the uid 40000 would be 10000 times more likely to be selected
> than average.
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