********* ********<suvisor.r...@gmail.com> wrote: > Kevin Grittner <kevin.gritt...@wicourts.gov> *******: >> what you have written will scan the entire table and give each >> row a 1 in 100000 chance of being selected. >> > Hmm, is this because random() marked as volatile (and would be > called for every row)? Ups, I not taken this into account... The VOLATILE marker *guarantees* that random() will be run for every row, but even with an immutable function you would be taking your chances on how it might run, with the way it was coded. The semantics are made unambiguous (I think) by making it a subquery in the FROM clause. -Kevin
-- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs