pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Correctly re-use hash tables in buildSubPlanHash(). 3+ messages / 1 participants [nested] [flat]
* pgsql: Correctly re-use hash tables in buildSubPlanHash(). @ 2020-02-29 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-02-29 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly re-use hash tables in buildSubPlanHash(). Commit 356687bd8 omitted to remove leftover code for destroying a hashed subplan's hash tables, with the result that the tables were always rebuilt not reused; this leads to severe memory leakage if a hashed subplan is re-executed enough times. Moreover, the code for reusing the hashnulls table had a typo that would have made it do the wrong thing if it were reached. Looking at the code coverage report shows severe under-coverage of the potential callers of ResetTupleHashTable, so add some test cases that exercise them. Andreas Karlsson and Tom Lane, per reports from Ranier Vilela and Justin Pryzby. Backpatch to v11, as the faulty commit was. Discussion: https://postgr.es/m/edb62547-c453-c35b-3ed6-a069e4d6b937@proxel.se Discussion: https://postgr.es/m/CAEudQAo=DCebm1RXtig9OH+QivpS97sMkikt0A9qHmMUs+g6ZA@mail.gmail.com Discussion: https://postgr.es/m/20200210032547.GA1412@telsasoft.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/58c47ccfff20b8c125903482725c1dbfd30beade Modified Files -------------- src/backend/executor/nodeSubplan.c | 6 +- src/test/regress/expected/subselect.out | 123 ++++++++++++++++++++++++++++++++ src/test/regress/sql/subselect.sql | 65 +++++++++++++++++ 3 files changed, 191 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Correctly re-use hash tables in buildSubPlanHash(). @ 2020-02-29 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-02-29 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly re-use hash tables in buildSubPlanHash(). Commit 356687bd8 omitted to remove leftover code for destroying a hashed subplan's hash tables, with the result that the tables were always rebuilt not reused; this leads to severe memory leakage if a hashed subplan is re-executed enough times. Moreover, the code for reusing the hashnulls table had a typo that would have made it do the wrong thing if it were reached. Looking at the code coverage report shows severe under-coverage of the potential callers of ResetTupleHashTable, so add some test cases that exercise them. Andreas Karlsson and Tom Lane, per reports from Ranier Vilela and Justin Pryzby. Backpatch to v11, as the faulty commit was. Discussion: https://postgr.es/m/edb62547-c453-c35b-3ed6-a069e4d6b937@proxel.se Discussion: https://postgr.es/m/CAEudQAo=DCebm1RXtig9OH+QivpS97sMkikt0A9qHmMUs+g6ZA@mail.gmail.com Discussion: https://postgr.es/m/20200210032547.GA1412@telsasoft.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/96d783ae55b9406f1b5e689e1e7afe8d21e3a549 Modified Files -------------- src/backend/executor/nodeSubplan.c | 6 +- src/test/regress/expected/subselect.out | 123 ++++++++++++++++++++++++++++++++ src/test/regress/sql/subselect.sql | 65 +++++++++++++++++ 3 files changed, 191 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Correctly re-use hash tables in buildSubPlanHash(). @ 2020-02-29 18:48 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2020-02-29 18:48 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Correctly re-use hash tables in buildSubPlanHash(). Commit 356687bd8 omitted to remove leftover code for destroying a hashed subplan's hash tables, with the result that the tables were always rebuilt not reused; this leads to severe memory leakage if a hashed subplan is re-executed enough times. Moreover, the code for reusing the hashnulls table had a typo that would have made it do the wrong thing if it were reached. Looking at the code coverage report shows severe under-coverage of the potential callers of ResetTupleHashTable, so add some test cases that exercise them. Andreas Karlsson and Tom Lane, per reports from Ranier Vilela and Justin Pryzby. Backpatch to v11, as the faulty commit was. Discussion: https://postgr.es/m/edb62547-c453-c35b-3ed6-a069e4d6b937@proxel.se Discussion: https://postgr.es/m/CAEudQAo=DCebm1RXtig9OH+QivpS97sMkikt0A9qHmMUs+g6ZA@mail.gmail.com Discussion: https://postgr.es/m/20200210032547.GA1412@telsasoft.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9eb6b652a46d0b13658be80013f5b893ac1d7894 Modified Files -------------- src/backend/executor/nodeSubplan.c | 6 +- src/test/regress/expected/subselect.out | 123 ++++++++++++++++++++++++++++++++ src/test/regress/sql/subselect.sql | 65 +++++++++++++++++ 3 files changed, 191 insertions(+), 3 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2020-02-29 18:48 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-02-29 18:48 pgsql: Correctly re-use hash tables in buildSubPlanHash(). Tom Lane <tgl@sss.pgh.pa.us> 2020-02-29 18:48 pgsql: Correctly re-use hash tables in buildSubPlanHash(). Tom Lane <tgl@sss.pgh.pa.us> 2020-02-29 18:48 pgsql: Correctly re-use hash tables in buildSubPlanHash(). 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