pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrey Lepikhov <a.lepikhov@postgrespro.ru>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Optimization issue of branching UNION ALL
Date: Thu, 22 Dec 2022 16:59:41 +0500
Message-ID: <628db719-9c26-7aa3-540d-9b6d68e68da6@postgrespro.ru> (raw)
In-Reply-To: <1788831.1671673839@sss.pgh.pa.us>
References: <703c09a2-08f3-d2ec-b33d-dbecd62428b8@postgrespro.ru>
	<1788831.1671673839@sss.pgh.pa.us>

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






view thread (7+ messages)  latest in thread

Message-ID: <628db719-9c26-7aa3-540d-9b6d68e68da6@postgrespro.ru>
Permalink:  ../628db719-9c26-7aa3-540d-9b6d68e68da6@postgrespro.ru/
Also on:    postgresql.org/message-id/628db719-9c26-7aa3-540d-9b6d68e68da6@postgrespro.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: a.lepikhov@postgrespro.ru, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: Optimization issue of branching UNION ALL
  In-Reply-To: <628db719-9c26-7aa3-540d-9b6d68e68da6@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox