pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Build EC members for child join rels in the right memory context
3+ messages / 1 participants
[nested] [flat]

* pgsql: Build EC members for child join rels in the right memory context
@ 2020-10-06 15:44 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2020-10-06 15:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Build EC members for child join rels in the right memory context.

This patch prevents crashes or wrong plans when partition-wise joins
are considered during GEQO planning, as a consequence of the
EquivalenceClass data structures becoming corrupt after a GEQO
context reset.

A remaining problem is that successive GEQO cycles will make multiple
copies of the required EC members, since add_child_join_rel_equivalences
has no idea that such members might exist already.  For now we'll just
live with that.  The lack of field complaints of crashes suggests that
this is a mighty little-used situation.

Back-patch to v12 where this code was introduced.

Discussion: https://postgr.es/m/1683100.1601860653@sss.pgh.pa.us

Branch
------
master

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

Modified Files
--------------
src/backend/optimizer/path/equivclass.c | 13 +++++++++++++
1 file changed, 13 insertions(+)



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

* pgsql: Build EC members for child join rels in the right memory context
@ 2020-10-06 15:44 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2020-10-06 15:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Build EC members for child join rels in the right memory context.

This patch prevents crashes or wrong plans when partition-wise joins
are considered during GEQO planning, as a consequence of the
EquivalenceClass data structures becoming corrupt after a GEQO
context reset.

A remaining problem is that successive GEQO cycles will make multiple
copies of the required EC members, since add_child_join_rel_equivalences
has no idea that such members might exist already.  For now we'll just
live with that.  The lack of field complaints of crashes suggests that
this is a mighty little-used situation.

Back-patch to v12 where this code was introduced.

Discussion: https://postgr.es/m/1683100.1601860653@sss.pgh.pa.us

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/optimizer/path/equivclass.c | 13 +++++++++++++
1 file changed, 13 insertions(+)



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

* pgsql: Build EC members for child join rels in the right memory context
@ 2020-10-06 15:44 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2020-10-06 15:44 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Build EC members for child join rels in the right memory context.

This patch prevents crashes or wrong plans when partition-wise joins
are considered during GEQO planning, as a consequence of the
EquivalenceClass data structures becoming corrupt after a GEQO
context reset.

A remaining problem is that successive GEQO cycles will make multiple
copies of the required EC members, since add_child_join_rel_equivalences
has no idea that such members might exist already.  For now we'll just
live with that.  The lack of field complaints of crashes suggests that
this is a mighty little-used situation.

Back-patch to v12 where this code was introduced.

Discussion: https://postgr.es/m/1683100.1601860653@sss.pgh.pa.us

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3d69efc4f07d773329dfbd39d6ec67a025cf7339

Modified Files
--------------
src/backend/optimizer/path/equivclass.c | 13 +++++++++++++
1 file changed, 13 insertions(+)



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


end of thread, other threads:[~2020-10-06 15:44 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-10-06 15:44 pgsql: Build EC members for child join rels in the right memory context Tom Lane <tgl@sss.pgh.pa.us>
2020-10-06 15:44 pgsql: Build EC members for child join rels in the right memory context Tom Lane <tgl@sss.pgh.pa.us>
2020-10-06 15:44 pgsql: Build EC members for child join rels in the right memory context 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