pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) 3+ messages / 1 participants [nested] [flat]
* pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) @ 2018-08-13 01:07 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Andrew Gierth @ 2018-08-13 01:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Multiple calls to XMLTABLE in a query (e.g. laterally applying it to a table with an xml column, an important use-case) were leaking large amounts of memory into the per-query context, blowing up memory usage. Repair by reorganizing memory context usage in nodeTableFuncscan; use the usual per-tuple context for row-by-row evaluations instead of perValueCxt, and use the explicitly created context -- renamed from perValueCxt to perTableCxt -- for arguments and state for each individual table-generation operation. Backpatch to PG10 where this code was introduced. Original report by IRC user begriffs; analysis and patch by me. Reviewed by Tom Lane and Pavel Stehule. Discussion: https://postgr.es/m/153394403528.10284.7530399040974170549@wrigleys.postgresql.org Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/78f70e07e2cf42b95c9f0adb57e37cf6c1274ec3 Modified Files -------------- src/backend/executor/nodeTableFuncscan.c | 29 ++++++++++++++++++++++++----- src/include/nodes/execnodes.h | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) @ 2018-08-13 01:07 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Andrew Gierth @ 2018-08-13 01:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Multiple calls to XMLTABLE in a query (e.g. laterally applying it to a table with an xml column, an important use-case) were leaking large amounts of memory into the per-query context, blowing up memory usage. Repair by reorganizing memory context usage in nodeTableFuncscan; use the usual per-tuple context for row-by-row evaluations instead of perValueCxt, and use the explicitly created context -- renamed from perValueCxt to perTableCxt -- for arguments and state for each individual table-generation operation. Backpatch to PG10 where this code was introduced. Original report by IRC user begriffs; analysis and patch by me. Reviewed by Tom Lane and Pavel Stehule. Discussion: https://postgr.es/m/153394403528.10284.7530399040974170549@wrigleys.postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/07172d5aff8f43cd6ce09f57a0b56a535d7eaf45 Modified Files -------------- src/backend/executor/nodeTableFuncscan.c | 29 ++++++++++++++++++++++++----- src/include/nodes/execnodes.h | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
* pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) @ 2018-08-13 01:07 Andrew Gierth <rhodiumtoad@postgresql.org> 0 siblings, 0 replies; 3+ messages in thread From: Andrew Gierth @ 2018-08-13 01:07 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Multiple calls to XMLTABLE in a query (e.g. laterally applying it to a table with an xml column, an important use-case) were leaking large amounts of memory into the per-query context, blowing up memory usage. Repair by reorganizing memory context usage in nodeTableFuncscan; use the usual per-tuple context for row-by-row evaluations instead of perValueCxt, and use the explicitly created context -- renamed from perValueCxt to perTableCxt -- for arguments and state for each individual table-generation operation. Backpatch to PG10 where this code was introduced. Original report by IRC user begriffs; analysis and patch by me. Reviewed by Tom Lane and Pavel Stehule. Discussion: https://postgr.es/m/153394403528.10284.7530399040974170549@wrigleys.postgresql.org Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/556140424c4b46a7076cdf13f306bd92db797b61 Modified Files -------------- src/backend/executor/nodeTableFuncscan.c | 29 ++++++++++++++++++++++++----- src/include/nodes/execnodes.h | 2 +- 2 files changed, 25 insertions(+), 6 deletions(-) ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2018-08-13 01:07 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2018-08-13 01:07 pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Andrew Gierth <rhodiumtoad@postgresql.org> 2018-08-13 01:07 pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Andrew Gierth <rhodiumtoad@postgresql.org> 2018-08-13 01:07 pgsql: Avoid query-lifetime memory leaks in XMLTABLE (bug #15321) Andrew Gierth <rhodiumtoad@postgresql.org>
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