Re: Optimizing maximum/minimum queries (yet again)

Поиск
Список
Период
Сортировка
От Neil Conway
Тема Re: Optimizing maximum/minimum queries (yet again)
Дата
Msg-id 42575EA8.7030302@samurai.com
обсуждение исходный текст
Ответ на Re: Optimizing maximum/minimum queries (yet again)  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Optimizing maximum/minimum queries (yet again)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane wrote:
> All that this optimization might do is to further cut the fraction of
> table rows at which the volatile function actually gets checked.  So
> I'm not seeing that it would break any code that worked reliably before.

Hmm; what about
    SELECT min(x), min(x) FROM tab WHERE random() > 0.5;

Applying the optimization would mean the two min(x) expressions would 
likely be different, which seems rather weird.

> Still, if it makes you feel at all uncomfortable, we can just refuse
> the optimization in such cases.

I'd say that's probably safest.

-Neil


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: [PATCHES] DELETE ... USING
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Optimizing maximum/minimum queries (yet again)