Re: BUG #15820: Commuting two column make a SubqueryScan node to appear in the plan - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #15820: Commuting two column make a SubqueryScan node to appear in the plan
Date
Msg-id 65155.1558962574@sss.pgh.pa.us
Whole thread Raw
In response to BUG #15820: Commuting two column make a SubqueryScan node to appear in the plan  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15820: Commuting two column make a SubqueryScan node to appear in the plan
Next
From: PG Bug reporting form
Date:
Subject: BUG #15821: Parallel Workers with functions and auto_explain: ERROR: could not find key 3 in shm TOC