Re: pull-up subquery if JOIN-ON contains refs to upper-query

Поиск
Список
Период
Сортировка
От Ilia Evdokimov
Тема Re: pull-up subquery if JOIN-ON contains refs to upper-query
Дата
Msg-id 32446f52-1b18-499a-a77b-d6b66ad0f4cf@tantorlabs.com
обсуждение исходный текст
Ответ на Re: pull-up subquery if JOIN-ON contains refs to upper-query  (Alena Rybakina <a.rybakina@postgrespro.ru>)
Ответы Re: pull-up subquery if JOIN-ON contains refs to upper-query
Список pgsql-hackers
On 02.04.2025 19:39, Alena Rybakina wrote:
>
> I see that I need to add a walker that, when traversing the tree, 
> determines whether there are conditions under which pull-up is 
> impossible - the presence of
> volatility of functions and other restrictions, and leave the 
> transformation for the var objects that I added before, I described it 
> here.
>

I have some concerns about pulling up every clause from the subquery 
with one column. In particular, not every clause is safe or beneficial 
to pull up: OR-clauses, CASE expressions, nested sublinks could 
significantly change how the planner estimates the number of rows or 
applies filters, especially when they are not true join predicates. 
Pulling them up might lead to worse plans, or even change the semantics 
in subtle ways. I think before applying such transformations, we should 
make sure they are not only safe but actually improve the resulting plan.




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