Re: Optimize common expressions in projection evaluation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Optimize common expressions in projection evaluation
Дата
Msg-id 3102800.1670215673@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Optimize common expressions in projection evaluation  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> po 5. 12. 2022 v 5:28 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
>> I tend to agree with David that LATERAL offers a good-enough
>> solution in most cases ... but it is annoying that we accept
>> this syntax and then pessimize it.

> I agree, so there is a perfect solution like don't use .*, but on second
> hand any supported syntax should be optimized well or we should raise some
> warning about negative performance impact.

Yeah.  I wonder if we could get the parser to automatically transform

    SELECT (foo(t.x)).* FROM tab t

into

    SELECT f.* FROM tab t, LATERAL foo(t.x) f

There are probably cases where this doesn't work or changes the
semantics subtly, but I suspect it could be made to work in
most cases of practical interest.

            regards, tom lane



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

Предыдущее
От: David Rowley
Дата:
Сообщение: Re: Bug in row_number() optimization
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Optimize common expressions in projection evaluation