Re: ORDER BY vs. volatile functions

Поиск
Список
Период
Сортировка
От Andrew Gierth
Тема Re: ORDER BY vs. volatile functions
Дата
Msg-id 87my2mgy4s.fsf@news-spur.riddles.org.uk
обсуждение исходный текст
Ответ на Re: ORDER BY vs. volatile functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: ORDER BY vs. volatile functions
Список pgsql-hackers
>>>>> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>> For bonus weirdness:
>> select distinct random(),random() from generate_series(1,10);>> set enable_hashagg=off;>> select distinct
random(),random()from generate_series(1,10);
 
>> I think _that_ one is a bug.
Tom> Hmm.  I think the first one is a bug --- the two invocations ofTom> random() in the tlist shouldn't be folded
together.

That's what I meant.

If you try it using nextval(), you'll notice that the function does
in fact get called twice per row, but one of the results is thrown
away and replaced with the other one.

-- 
Andrew.


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: next CommitFest
Следующее
От: Tom Lane
Дата:
Сообщение: Re: ORDER BY vs. volatile functions