pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: luis.carril@swarm64.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15820: Commuting two column make a SubqueryScan node to appear in the plan
Date: Mon, 27 May 2019 09:09:34 -0400
Message-ID: <65155.1558962574@sss.pgh.pa.us> (raw)
In-Reply-To: <15820-adc0b2f210dc1d49@postgresql.org>
References: <15820-adc0b2f210dc1d49@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
>    switching the order of two columns make a SubqueryScan node to appear in
> the plan. It seems completely trivial as the cost is not modified, should it
> also be removed in the second case?

No.  The SubqueryScan can only be optimized away if it makes no changes
in the result tuple.

Conceivably, with sufficiently complicated hacking in setrefs.c,
simple cases like column reordering could be handled there.  But
I'm doubtful that it's worth the added cycles & risk of bugs.

			regards, tom lane





view thread (2+ messages)

Message-ID: <65155.1558962574@sss.pgh.pa.us>
Permalink:  ../65155.1558962574@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/65155.1558962574@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, luis.carril@swarm64.com
  Subject: Re: BUG #15820: Commuting two column make a SubqueryScan node to appear in the plan
  In-Reply-To: <65155.1558962574@sss.pgh.pa.us>
  References: <15820-adc0b2f210dc1d49@postgresql.org> <65155.1558962574@sss.pgh.pa.us>

* 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