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

* pgsql: Repair more failures with SubPlans in multi-row VALUES lists.
@ 2020-01-17 21:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-01-17 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Repair more failures with SubPlans in multi-row VALUES lists.

Commit 9b63c13f0 turns out to have been fundamentally misguided:
the parent node's subPlan list is by no means the only way in which
a child SubPlan node can be hooked into the outer execution state.
As shown in bug #16213 from Matt Jibson, we can also get short-lived
tuple table slots added to the outer es_tupleTable list.  At this point
I have little faith that there aren't other possible connections as
well; the long time it took to notice this problem shows that this
isn't a heavily-exercised situation.

Therefore, revert that fix, returning to the coding that passed a
NULL parent plan pointer down to the transiently-built subexpressions.
That gives us a pretty good guarantee that they won't hook into the
outer executor state in any way.  But then we need some other solution
to make SubPlans work.  Adopt the solution speculated about in the
previous commit's log message: do expression initialization at plan
startup for just those VALUES rows containing SubPlans, abandoning the
goal of reclaiming memory intra-query for those rows.  In practice it
seems unlikely that queries containing a vast number of VALUES rows
would be using SubPlans in them, so this should not give up much.

(BTW, this test case also refutes my claim in connection with the prior
commit that the issue only arises with use of LATERAL.  That was just
wrong: some variants of SubLink always produce SubPlans.)

As with previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/16213-871ac3bc208ecf23@postgresql.org

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/167fd022ff3377f18b84de194ee728c91921dc3f

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 83 ++++++++++++++++++++-------------
src/include/nodes/execnodes.h           | 11 ++++-
src/test/regress/expected/subselect.out | 27 +++++++++++
src/test/regress/sql/subselect.sql      | 14 ++++++
4 files changed, 101 insertions(+), 34 deletions(-)



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

* pgsql: Repair more failures with SubPlans in multi-row VALUES lists.
@ 2020-01-17 21:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-01-17 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Repair more failures with SubPlans in multi-row VALUES lists.

Commit 9b63c13f0 turns out to have been fundamentally misguided:
the parent node's subPlan list is by no means the only way in which
a child SubPlan node can be hooked into the outer execution state.
As shown in bug #16213 from Matt Jibson, we can also get short-lived
tuple table slots added to the outer es_tupleTable list.  At this point
I have little faith that there aren't other possible connections as
well; the long time it took to notice this problem shows that this
isn't a heavily-exercised situation.

Therefore, revert that fix, returning to the coding that passed a
NULL parent plan pointer down to the transiently-built subexpressions.
That gives us a pretty good guarantee that they won't hook into the
outer executor state in any way.  But then we need some other solution
to make SubPlans work.  Adopt the solution speculated about in the
previous commit's log message: do expression initialization at plan
startup for just those VALUES rows containing SubPlans, abandoning the
goal of reclaiming memory intra-query for those rows.  In practice it
seems unlikely that queries containing a vast number of VALUES rows
would be using SubPlans in them, so this should not give up much.

(BTW, this test case also refutes my claim in connection with the prior
commit that the issue only arises with use of LATERAL.  That was just
wrong: some variants of SubLink always produce SubPlans.)

As with previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/16213-871ac3bc208ecf23@postgresql.org

Branch
------
REL9_4_STABLE

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

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 83 ++++++++++++++++++++-------------
src/include/nodes/execnodes.h           | 11 ++++-
src/test/regress/expected/subselect.out | 27 +++++++++++
src/test/regress/sql/subselect.sql      | 14 ++++++
4 files changed, 101 insertions(+), 34 deletions(-)



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

* pgsql: Repair more failures with SubPlans in multi-row VALUES lists.
@ 2020-01-17 21:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-01-17 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Repair more failures with SubPlans in multi-row VALUES lists.

Commit 9b63c13f0 turns out to have been fundamentally misguided:
the parent node's subPlan list is by no means the only way in which
a child SubPlan node can be hooked into the outer execution state.
As shown in bug #16213 from Matt Jibson, we can also get short-lived
tuple table slots added to the outer es_tupleTable list.  At this point
I have little faith that there aren't other possible connections as
well; the long time it took to notice this problem shows that this
isn't a heavily-exercised situation.

Therefore, revert that fix, returning to the coding that passed a
NULL parent plan pointer down to the transiently-built subexpressions.
That gives us a pretty good guarantee that they won't hook into the
outer executor state in any way.  But then we need some other solution
to make SubPlans work.  Adopt the solution speculated about in the
previous commit's log message: do expression initialization at plan
startup for just those VALUES rows containing SubPlans, abandoning the
goal of reclaiming memory intra-query for those rows.  In practice it
seems unlikely that queries containing a vast number of VALUES rows
would be using SubPlans in them, so this should not give up much.

(BTW, this test case also refutes my claim in connection with the prior
commit that the issue only arises with use of LATERAL.  That was just
wrong: some variants of SubLink always produce SubPlans.)

As with previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/16213-871ac3bc208ecf23@postgresql.org

Branch
------
REL_12_STABLE

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

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 110 ++++++++++++++++++++------------
src/include/nodes/execnodes.h           |  11 +++-
src/test/regress/expected/subselect.out |  27 ++++++++
src/test/regress/sql/subselect.sql      |  14 ++++
4 files changed, 119 insertions(+), 43 deletions(-)



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

* pgsql: Repair more failures with SubPlans in multi-row VALUES lists.
@ 2020-01-17 21:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-01-17 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Repair more failures with SubPlans in multi-row VALUES lists.

Commit 9b63c13f0 turns out to have been fundamentally misguided:
the parent node's subPlan list is by no means the only way in which
a child SubPlan node can be hooked into the outer execution state.
As shown in bug #16213 from Matt Jibson, we can also get short-lived
tuple table slots added to the outer es_tupleTable list.  At this point
I have little faith that there aren't other possible connections as
well; the long time it took to notice this problem shows that this
isn't a heavily-exercised situation.

Therefore, revert that fix, returning to the coding that passed a
NULL parent plan pointer down to the transiently-built subexpressions.
That gives us a pretty good guarantee that they won't hook into the
outer executor state in any way.  But then we need some other solution
to make SubPlans work.  Adopt the solution speculated about in the
previous commit's log message: do expression initialization at plan
startup for just those VALUES rows containing SubPlans, abandoning the
goal of reclaiming memory intra-query for those rows.  In practice it
seems unlikely that queries containing a vast number of VALUES rows
would be using SubPlans in them, so this should not give up much.

(BTW, this test case also refutes my claim in connection with the prior
commit that the issue only arises with use of LATERAL.  That was just
wrong: some variants of SubLink always produce SubPlans.)

As with previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/16213-871ac3bc208ecf23@postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/45f03cfa56c88a3c662436027f076ad2b667287e

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 83 ++++++++++++++++++++-------------
src/include/nodes/execnodes.h           | 11 ++++-
src/test/regress/expected/subselect.out | 27 +++++++++++
src/test/regress/sql/subselect.sql      | 14 ++++++
4 files changed, 101 insertions(+), 34 deletions(-)



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

* pgsql: Repair more failures with SubPlans in multi-row VALUES lists.
@ 2020-01-17 21:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-01-17 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Repair more failures with SubPlans in multi-row VALUES lists.

Commit 9b63c13f0 turns out to have been fundamentally misguided:
the parent node's subPlan list is by no means the only way in which
a child SubPlan node can be hooked into the outer execution state.
As shown in bug #16213 from Matt Jibson, we can also get short-lived
tuple table slots added to the outer es_tupleTable list.  At this point
I have little faith that there aren't other possible connections as
well; the long time it took to notice this problem shows that this
isn't a heavily-exercised situation.

Therefore, revert that fix, returning to the coding that passed a
NULL parent plan pointer down to the transiently-built subexpressions.
That gives us a pretty good guarantee that they won't hook into the
outer executor state in any way.  But then we need some other solution
to make SubPlans work.  Adopt the solution speculated about in the
previous commit's log message: do expression initialization at plan
startup for just those VALUES rows containing SubPlans, abandoning the
goal of reclaiming memory intra-query for those rows.  In practice it
seems unlikely that queries containing a vast number of VALUES rows
would be using SubPlans in them, so this should not give up much.

(BTW, this test case also refutes my claim in connection with the prior
commit that the issue only arises with use of LATERAL.  That was just
wrong: some variants of SubLink always produce SubPlans.)

As with previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/16213-871ac3bc208ecf23@postgresql.org

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/41c6f9db25b5e3a8bb8afbb7d6715cff541fd41e

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 110 ++++++++++++++++++++------------
src/include/nodes/execnodes.h           |  10 ++-
src/test/regress/expected/subselect.out |  27 ++++++++
src/test/regress/sql/subselect.sql      |  14 ++++
4 files changed, 118 insertions(+), 43 deletions(-)



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

* pgsql: Repair more failures with SubPlans in multi-row VALUES lists.
@ 2020-01-17 21:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-01-17 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Repair more failures with SubPlans in multi-row VALUES lists.

Commit 9b63c13f0 turns out to have been fundamentally misguided:
the parent node's subPlan list is by no means the only way in which
a child SubPlan node can be hooked into the outer execution state.
As shown in bug #16213 from Matt Jibson, we can also get short-lived
tuple table slots added to the outer es_tupleTable list.  At this point
I have little faith that there aren't other possible connections as
well; the long time it took to notice this problem shows that this
isn't a heavily-exercised situation.

Therefore, revert that fix, returning to the coding that passed a
NULL parent plan pointer down to the transiently-built subexpressions.
That gives us a pretty good guarantee that they won't hook into the
outer executor state in any way.  But then we need some other solution
to make SubPlans work.  Adopt the solution speculated about in the
previous commit's log message: do expression initialization at plan
startup for just those VALUES rows containing SubPlans, abandoning the
goal of reclaiming memory intra-query for those rows.  In practice it
seems unlikely that queries containing a vast number of VALUES rows
would be using SubPlans in them, so this should not give up much.

(BTW, this test case also refutes my claim in connection with the prior
commit that the issue only arises with use of LATERAL.  That was just
wrong: some variants of SubLink always produce SubPlans.)

As with previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/16213-871ac3bc208ecf23@postgresql.org

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3964722780d811430521b6051bc350ead03fb708

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 83 ++++++++++++++++++++-------------
src/include/nodes/execnodes.h           | 11 ++++-
src/test/regress/expected/subselect.out | 27 +++++++++++
src/test/regress/sql/subselect.sql      | 14 ++++++
4 files changed, 101 insertions(+), 34 deletions(-)



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

* pgsql: Repair more failures with SubPlans in multi-row VALUES lists.
@ 2020-01-17 21:17  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2020-01-17 21:17 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Repair more failures with SubPlans in multi-row VALUES lists.

Commit 9b63c13f0 turns out to have been fundamentally misguided:
the parent node's subPlan list is by no means the only way in which
a child SubPlan node can be hooked into the outer execution state.
As shown in bug #16213 from Matt Jibson, we can also get short-lived
tuple table slots added to the outer es_tupleTable list.  At this point
I have little faith that there aren't other possible connections as
well; the long time it took to notice this problem shows that this
isn't a heavily-exercised situation.

Therefore, revert that fix, returning to the coding that passed a
NULL parent plan pointer down to the transiently-built subexpressions.
That gives us a pretty good guarantee that they won't hook into the
outer executor state in any way.  But then we need some other solution
to make SubPlans work.  Adopt the solution speculated about in the
previous commit's log message: do expression initialization at plan
startup for just those VALUES rows containing SubPlans, abandoning the
goal of reclaiming memory intra-query for those rows.  In practice it
seems unlikely that queries containing a vast number of VALUES rows
would be using SubPlans in them, so this should not give up much.

(BTW, this test case also refutes my claim in connection with the prior
commit that the issue only arises with use of LATERAL.  That was just
wrong: some variants of SubLink always produce SubPlans.)

As with previous patch, back-patch to all supported branches.

Discussion: https://postgr.es/m/16213-871ac3bc208ecf23@postgresql.org

Branch
------
REL_11_STABLE

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

Modified Files
--------------
src/backend/executor/nodeValuesscan.c   | 110 ++++++++++++++++++++------------
src/include/nodes/execnodes.h           |  11 +++-
src/test/regress/expected/subselect.out |  27 ++++++++
src/test/regress/sql/subselect.sql      |  14 ++++
4 files changed, 119 insertions(+), 43 deletions(-)



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


end of thread, other threads:[~2020-01-17 21:17 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 21:17 pgsql: Repair more failures with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2020-01-17 21:17 pgsql: Repair more failures with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2020-01-17 21:17 pgsql: Repair more failures with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2020-01-17 21:17 pgsql: Repair more failures with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2020-01-17 21:17 pgsql: Repair more failures with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2020-01-17 21:17 pgsql: Repair more failures with SubPlans in multi-row VALUES lists. Tom Lane <tgl@sss.pgh.pa.us>
2020-01-17 21:17 pgsql: Repair more failures 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