pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Repair failure with SubPlans in multi-row VALUES lists.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Repair failure with SubPlans in multi-row VALUES lists.
@ 2017-11-25 19:16  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-11-25 19:16 UTC (permalink / raw)
  To: pgsql-committers

Repair failure with SubPlans in multi-row VALUES lists.

When nodeValuesscan.c was written, it was impossible to have a SubPlan in
VALUES --- any sub-SELECT there would have to be uncorrelated and thereby
would produce an InitPlan instead.  We therefore took a shortcut in the
logic that throws away a ValuesScan's per-row expression evaluation data
structures.  This was broken by the introduction of LATERAL however; a
sub-SELECT containing a lateral reference produces a correlated SubPlan.

The cleanest fix for this would be to give up the optimization of
discarding the expression eval state.  But that still seems pretty
unappetizing for long VALUES lists.  It seems to work to just prevent
the subexpressions from hooking into the ValuesScan node's subPlan
list, so let's do that and see how well it works.  (If this breaks,
due to additional connections between the subexpressions and the outer
query structures, we might consider compromises like throwing away data
only for VALUES rows not containing SubPlans.)

Per bug #14924 from Christian Duta.  Back-patch to 9.3 where LATERAL
was introduced.

Discussion: https://postgr.es/m/20171124120836.1463.5310@wrigleys.postgresql.org

Branch
------
REL9_4_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2e105cf6db214ec69e62e4c4dfc71e39879485ae

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 21 ++++++++++++++++-----
src/test/regress/expected/subselect.out | 30 ++++++++++++++++++++++++++++++
src/test/regress/sql/subselect.sql      | 10 ++++++++++
3 files changed, 56 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Repair failure with SubPlans in multi-row VALUES lists.
@ 2017-11-25 19:16  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-11-25 19:16 UTC (permalink / raw)
  To: pgsql-committers

Repair failure with SubPlans in multi-row VALUES lists.

When nodeValuesscan.c was written, it was impossible to have a SubPlan in
VALUES --- any sub-SELECT there would have to be uncorrelated and thereby
would produce an InitPlan instead.  We therefore took a shortcut in the
logic that throws away a ValuesScan's per-row expression evaluation data
structures.  This was broken by the introduction of LATERAL however; a
sub-SELECT containing a lateral reference produces a correlated SubPlan.

The cleanest fix for this would be to give up the optimization of
discarding the expression eval state.  But that still seems pretty
unappetizing for long VALUES lists.  It seems to work to just prevent
the subexpressions from hooking into the ValuesScan node's subPlan
list, so let's do that and see how well it works.  (If this breaks,
due to additional connections between the subexpressions and the outer
query structures, we might consider compromises like throwing away data
only for VALUES rows not containing SubPlans.)

Per bug #14924 from Christian Duta.  Back-patch to 9.3 where LATERAL
was introduced.

Discussion: https://postgr.es/m/20171124120836.1463.5310@wrigleys.postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9b63c13f0a213bfb38bb70a3df3f28cc1f496b30

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 21 ++++++++++++++++-----
src/test/regress/expected/subselect.out | 30 ++++++++++++++++++++++++++++++
src/test/regress/sql/subselect.sql      | 10 ++++++++++
3 files changed, 56 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Repair failure with SubPlans in multi-row VALUES lists.
@ 2017-11-25 19:16  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-11-25 19:16 UTC (permalink / raw)
  To: pgsql-committers

Repair failure with SubPlans in multi-row VALUES lists.

When nodeValuesscan.c was written, it was impossible to have a SubPlan in
VALUES --- any sub-SELECT there would have to be uncorrelated and thereby
would produce an InitPlan instead.  We therefore took a shortcut in the
logic that throws away a ValuesScan's per-row expression evaluation data
structures.  This was broken by the introduction of LATERAL however; a
sub-SELECT containing a lateral reference produces a correlated SubPlan.

The cleanest fix for this would be to give up the optimization of
discarding the expression eval state.  But that still seems pretty
unappetizing for long VALUES lists.  It seems to work to just prevent
the subexpressions from hooking into the ValuesScan node's subPlan
list, so let's do that and see how well it works.  (If this breaks,
due to additional connections between the subexpressions and the outer
query structures, we might consider compromises like throwing away data
only for VALUES rows not containing SubPlans.)

Per bug #14924 from Christian Duta.  Back-patch to 9.3 where LATERAL
was introduced.

Discussion: https://postgr.es/m/20171124120836.1463.5310@wrigleys.postgresql.org

Branch
------
REL9_3_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d538f65684a50214240b26f39d1062e9800139dd

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 21 ++++++++++++++++-----
src/test/regress/expected/subselect.out | 30 ++++++++++++++++++++++++++++++
src/test/regress/sql/subselect.sql      | 10 ++++++++++
3 files changed, 56 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Repair failure with SubPlans in multi-row VALUES lists.
@ 2017-11-25 19:16  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-11-25 19:16 UTC (permalink / raw)
  To: pgsql-committers

Repair failure with SubPlans in multi-row VALUES lists.

When nodeValuesscan.c was written, it was impossible to have a SubPlan in
VALUES --- any sub-SELECT there would have to be uncorrelated and thereby
would produce an InitPlan instead.  We therefore took a shortcut in the
logic that throws away a ValuesScan's per-row expression evaluation data
structures.  This was broken by the introduction of LATERAL however; a
sub-SELECT containing a lateral reference produces a correlated SubPlan.

The cleanest fix for this would be to give up the optimization of
discarding the expression eval state.  But that still seems pretty
unappetizing for long VALUES lists.  It seems to work to just prevent
the subexpressions from hooking into the ValuesScan node's subPlan
list, so let's do that and see how well it works.  (If this breaks,
due to additional connections between the subexpressions and the outer
query structures, we might consider compromises like throwing away data
only for VALUES rows not containing SubPlans.)

Per bug #14924 from Christian Duta.  Back-patch to 9.3 where LATERAL
was introduced.

Discussion: https://postgr.es/m/20171124120836.1463.5310@wrigleys.postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/497e79b96135ba6d37cf6b321ad485a2474cb053

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 21 ++++++++++++++++-----
src/test/regress/expected/subselect.out | 30 ++++++++++++++++++++++++++++++
src/test/regress/sql/subselect.sql      | 10 ++++++++++
3 files changed, 56 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Repair failure with SubPlans in multi-row VALUES lists.
@ 2017-11-25 19:16  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-11-25 19:16 UTC (permalink / raw)
  To: pgsql-committers

Repair failure with SubPlans in multi-row VALUES lists.

When nodeValuesscan.c was written, it was impossible to have a SubPlan in
VALUES --- any sub-SELECT there would have to be uncorrelated and thereby
would produce an InitPlan instead.  We therefore took a shortcut in the
logic that throws away a ValuesScan's per-row expression evaluation data
structures.  This was broken by the introduction of LATERAL however; a
sub-SELECT containing a lateral reference produces a correlated SubPlan.

The cleanest fix for this would be to give up the optimization of
discarding the expression eval state.  But that still seems pretty
unappetizing for long VALUES lists.  It seems to work to just prevent
the subexpressions from hooking into the ValuesScan node's subPlan
list, so let's do that and see how well it works.  (If this breaks,
due to additional connections between the subexpressions and the outer
query structures, we might consider compromises like throwing away data
only for VALUES rows not containing SubPlans.)

Per bug #14924 from Christian Duta.  Back-patch to 9.3 where LATERAL
was introduced.

Discussion: https://postgr.es/m/20171124120836.1463.5310@wrigleys.postgresql.org

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ae6ed07841766867ab7c0f04b996deee140dba19

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 21 ++++++++++++++++-----
src/test/regress/expected/subselect.out | 30 ++++++++++++++++++++++++++++++
src/test/regress/sql/subselect.sql      | 10 ++++++++++
3 files changed, 56 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* pgsql: Repair failure with SubPlans in multi-row VALUES lists.
@ 2017-11-25 19:16  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-11-25 19:16 UTC (permalink / raw)
  To: pgsql-committers

Repair failure with SubPlans in multi-row VALUES lists.

When nodeValuesscan.c was written, it was impossible to have a SubPlan in
VALUES --- any sub-SELECT there would have to be uncorrelated and thereby
would produce an InitPlan instead.  We therefore took a shortcut in the
logic that throws away a ValuesScan's per-row expression evaluation data
structures.  This was broken by the introduction of LATERAL however; a
sub-SELECT containing a lateral reference produces a correlated SubPlan.

The cleanest fix for this would be to give up the optimization of
discarding the expression eval state.  But that still seems pretty
unappetizing for long VALUES lists.  It seems to work to just prevent
the subexpressions from hooking into the ValuesScan node's subPlan
list, so let's do that and see how well it works.  (If this breaks,
due to additional connections between the subexpressions and the outer
query structures, we might consider compromises like throwing away data
only for VALUES rows not containing SubPlans.)

Per bug #14924 from Christian Duta.  Back-patch to 9.3 where LATERAL
was introduced.

Discussion: https://postgr.es/m/20171124120836.1463.5310@wrigleys.postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5dc7faa91e195a64f58057b7fb90778abfec065c

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 21 ++++++++++++++++-----
src/test/regress/expected/subselect.out | 30 ++++++++++++++++++++++++++++++
src/test/regress/sql/subselect.sql      | 10 ++++++++++
3 files changed, 56 insertions(+), 5 deletions(-)



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2017-11-25 19:16 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-11-25 19:16 pgsql: Repair failure with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2017-11-25 19:16 pgsql: Repair failure with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2017-11-25 19:16 pgsql: Repair failure with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2017-11-25 19:16 pgsql: Repair failure with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2017-11-25 19:16 pgsql: Repair failure with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2017-11-25 19:16 pgsql: Repair failure with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>

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