********* ********<suvisor(dot)root(at)gmail(dot)com> wrote:
> Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)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.
In response to
pgsql-bugs by date
|Next:||From: Josh Kupershmidt||Date: 2012-04-23 23:51:34|
|Subject: Re: BUG #6609: pattern matching (version 8.2 or so...)|
|Previous:||From: Александр Шепляков||Date: 2012-04-23 22:23:38|
|Subject: Re: BUG #6607: Strange select behavior|