Re: BUG #16368: Incorrect function inlining in the presence of a window function

Поиск
Список
Период
Сортировка
От Elvis Pranskevichus
Тема Re: BUG #16368: Incorrect function inlining in the presence of a window function
Дата
Msg-id 7058335.0AJ8ntve86@hammer.magicstack.net
обсуждение исходный текст
Ответ на Re: BUG #16368: Incorrect function inlining in the presence of a window function  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #16368: Incorrect function inlining in the presence of awindow function  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-bugs
On Wednesday, April 15, 2020 5:14:05 P.M. PDT Tom Lane wrote:

> In point of fact, there are many ways in which CASE and related
> constructs fail to guarantee evaluation order, as noted in
> https://www.postgresql.org/docs/current/sql-expressions.html#SYNTAX-EX
> PRESS-EVAL
>
> The particular case mentioned there seems to be about the same as
> here: constant-folding happens even in CASE arms that will never be
> reached at runtime. 

Yes, but function arguments aren't constants are they?  At least the 
documentation makes no effort to mention that.

> would be quite unhappy with the performance impact of de-optimizing
> CASE that way.

I'm not arguing for the general de-optimization for CASE, just for not 
treating arguments of inlined functions as constants in the CASE 
statement.  For arguments of a prepared statement this optimization 
makes even less sense.  

                                Elvis





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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: BUG #16369: Segmentation Faults and Data Corruption withGenerated Columns
Следующее
От: Elvis Pranskevichus
Дата:
Сообщение: Re: BUG #16368: Incorrect function inlining in the presence of a window function