Re: Optimization issue of branching UNION ALL

From: Andrey Lepikhov <a(dot)lepikhov(at)postgrespro(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Optimization issue of branching UNION ALL
Date: 2022-12-22 11:59:41
Message-ID: 628db719-9c26-7aa3-540d-9b6d68e68da6@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 22/12/2022 06:50, Tom Lane wrote:
>> 2. Iterative passes along the append_rel_list for replacing vars in the
>> translated_vars field. I can't grasp real necessity of passing all the
>> append_rel_list during flattening of an union all leaf subquery. No one
>> can reference this leaf, isn't it?
>
> After thinking about that for awhile, I believe we can go further:
> the containing_appendrel is actually the *only* part of the upper
> query that needs to be adjusted. So we could do something like
> the attached.
>
> This passes check-world, but I don't have quite enough confidence
> in it to just commit it.
Thanks, I have written the letter because of some doubts too. But only
one weak point I could imagine - if someday sql standard will be changed.
Your code looks better, than previous attempt.

--
regards,
Andrey Lepikhov
Postgres Professional

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dag Lem 2022-12-22 12:00:43 Re: daitch_mokotoff module
Previous Message Ashutosh Bapat 2022-12-22 11:59:34 Re: Exit walsender before confirming remote flush in logical replication