Re: BUG #6607: Strange select behavior

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: BUG #6607: Strange select behavior
Дата
Msg-id 4F959339020000250004725A@gw.wicourts.gov
обсуждение исходный текст
Ответ на BUG #6607: Strange select behavior  (suvisor.root@gmail.com)
Список pgsql-bugs
********* ********<suvisor.root@gmail.com> wrote:
> Kevin Grittner <Kevin.Grittner@wicourts.gov> *******:
=20
>> 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...
=20
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.
=20
-Kevin

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: BUG #6607: Strange select behavior
Следующее
От: biju.george@ust-global.com
Дата:
Сообщение: BUG #6609: pattern matching (version 8.2 or so...)