pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Cache the results of format_type() queries in pg_dump. 7+ messages / 1 participants [nested] [flat]
* pgsql: Cache the results of format_type() queries in pg_dump. @ 2021-08-31 17:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-08-31 17:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Cache the results of format_type() queries in pg_dump. There's long been a "TODO: there might be some value in caching the results" annotation on pg_dump's getFormattedTypeName function; but we hadn't gotten around to checking what it was costing us to repetitively look up type names. It turns out that when dumping the current regression database, about 10% of the total number of queries issued are duplicative format_type() queries. However, Hubert Depesz Lubaczewski reported a not-unusual case where these account for over half of the queries issued by pg_dump. Individually these queries aren't expensive, but when network lag is a factor, they add up to a problem. We can very easily add some caching to getFormattedTypeName to solve it. Since this is such a simple fix and can have a visible performance benefit, back-patch to all supported branches. Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/6c450a861f1a928f44c9ae80814ed9a91927c25a Modified Files -------------- src/bin/pg_dump/pg_dump.c | 13 +++++++++++-- src/bin/pg_dump/pg_dump.h | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Cache the results of format_type() queries in pg_dump. @ 2021-08-31 17:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-08-31 17:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Cache the results of format_type() queries in pg_dump. There's long been a "TODO: there might be some value in caching the results" annotation on pg_dump's getFormattedTypeName function; but we hadn't gotten around to checking what it was costing us to repetitively look up type names. It turns out that when dumping the current regression database, about 10% of the total number of queries issued are duplicative format_type() queries. However, Hubert Depesz Lubaczewski reported a not-unusual case where these account for over half of the queries issued by pg_dump. Individually these queries aren't expensive, but when network lag is a factor, they add up to a problem. We can very easily add some caching to getFormattedTypeName to solve it. Since this is such a simple fix and can have a visible performance benefit, back-patch to all supported branches. Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com Branch ------ REL_14_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/9407dbbcb5b587cbefc4af14d1612b49abcb143b Modified Files -------------- src/bin/pg_dump/pg_dump.c | 13 +++++++++++-- src/bin/pg_dump/pg_dump.h | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Cache the results of format_type() queries in pg_dump. @ 2021-08-31 17:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-08-31 17:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Cache the results of format_type() queries in pg_dump. There's long been a "TODO: there might be some value in caching the results" annotation on pg_dump's getFormattedTypeName function; but we hadn't gotten around to checking what it was costing us to repetitively look up type names. It turns out that when dumping the current regression database, about 10% of the total number of queries issued are duplicative format_type() queries. However, Hubert Depesz Lubaczewski reported a not-unusual case where these account for over half of the queries issued by pg_dump. Individually these queries aren't expensive, but when network lag is a factor, they add up to a problem. We can very easily add some caching to getFormattedTypeName to solve it. Since this is such a simple fix and can have a visible performance benefit, back-patch to all supported branches. Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/904ce45bfa8862d4ae04065c8033182ad812b009 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 13 +++++++++++-- src/bin/pg_dump/pg_dump.h | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Cache the results of format_type() queries in pg_dump. @ 2021-08-31 17:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-08-31 17:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Cache the results of format_type() queries in pg_dump. There's long been a "TODO: there might be some value in caching the results" annotation on pg_dump's getFormattedTypeName function; but we hadn't gotten around to checking what it was costing us to repetitively look up type names. It turns out that when dumping the current regression database, about 10% of the total number of queries issued are duplicative format_type() queries. However, Hubert Depesz Lubaczewski reported a not-unusual case where these account for over half of the queries issued by pg_dump. Individually these queries aren't expensive, but when network lag is a factor, they add up to a problem. We can very easily add some caching to getFormattedTypeName to solve it. Since this is such a simple fix and can have a visible performance benefit, back-patch to all supported branches. Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com Branch ------ REL_12_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/2f1ed9d98c38a62ffa4b0a6589c9fcc529ae0883 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 13 +++++++++++-- src/bin/pg_dump/pg_dump.h | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Cache the results of format_type() queries in pg_dump. @ 2021-08-31 17:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-08-31 17:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Cache the results of format_type() queries in pg_dump. There's long been a "TODO: there might be some value in caching the results" annotation on pg_dump's getFormattedTypeName function; but we hadn't gotten around to checking what it was costing us to repetitively look up type names. It turns out that when dumping the current regression database, about 10% of the total number of queries issued are duplicative format_type() queries. However, Hubert Depesz Lubaczewski reported a not-unusual case where these account for over half of the queries issued by pg_dump. Individually these queries aren't expensive, but when network lag is a factor, they add up to a problem. We can very easily add some caching to getFormattedTypeName to solve it. Since this is such a simple fix and can have a visible performance benefit, back-patch to all supported branches. Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com Branch ------ REL_11_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/c4b298ee15aa67a953e65c8efa1a33eeea721446 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 13 +++++++++++-- src/bin/pg_dump/pg_dump.h | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Cache the results of format_type() queries in pg_dump. @ 2021-08-31 17:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-08-31 17:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Cache the results of format_type() queries in pg_dump. There's long been a "TODO: there might be some value in caching the results" annotation on pg_dump's getFormattedTypeName function; but we hadn't gotten around to checking what it was costing us to repetitively look up type names. It turns out that when dumping the current regression database, about 10% of the total number of queries issued are duplicative format_type() queries. However, Hubert Depesz Lubaczewski reported a not-unusual case where these account for over half of the queries issued by pg_dump. Individually these queries aren't expensive, but when network lag is a factor, they add up to a problem. We can very easily add some caching to getFormattedTypeName to solve it. Since this is such a simple fix and can have a visible performance benefit, back-patch to all supported branches. Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com Branch ------ REL_10_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/0e7bdc722c65045d85161c6ae0125743ae93d185 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 13 +++++++++++-- src/bin/pg_dump/pg_dump.h | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
* pgsql: Cache the results of format_type() queries in pg_dump. @ 2021-08-31 17:54 Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 7+ messages in thread From: Tom Lane @ 2021-08-31 17:54 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Cache the results of format_type() queries in pg_dump. There's long been a "TODO: there might be some value in caching the results" annotation on pg_dump's getFormattedTypeName function; but we hadn't gotten around to checking what it was costing us to repetitively look up type names. It turns out that when dumping the current regression database, about 10% of the total number of queries issued are duplicative format_type() queries. However, Hubert Depesz Lubaczewski reported a not-unusual case where these account for over half of the queries issued by pg_dump. Individually these queries aren't expensive, but when network lag is a factor, they add up to a problem. We can very easily add some caching to getFormattedTypeName to solve it. Since this is such a simple fix and can have a visible performance benefit, back-patch to all supported branches. Discussion: https://postgr.es/m/20210826084430.GA26282@depesz.com Branch ------ REL9_6_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/4645997c8ab7fd391df6cd2ff2bfebfc8a135242 Modified Files -------------- src/bin/pg_dump/pg_dump.c | 13 +++++++++++-- src/bin/pg_dump/pg_dump.h | 6 ++++-- 2 files changed, 15 insertions(+), 4 deletions(-) ^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2021-08-31 17:54 UTC | newest] Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2021-08-31 17:54 pgsql: Cache the results of format_type() queries in pg_dump. Tom Lane <tgl@sss.pgh.pa.us> 2021-08-31 17:54 pgsql: Cache the results of format_type() queries in pg_dump. Tom Lane <tgl@sss.pgh.pa.us> 2021-08-31 17:54 pgsql: Cache the results of format_type() queries in pg_dump. Tom Lane <tgl@sss.pgh.pa.us> 2021-08-31 17:54 pgsql: Cache the results of format_type() queries in pg_dump. Tom Lane <tgl@sss.pgh.pa.us> 2021-08-31 17:54 pgsql: Cache the results of format_type() queries in pg_dump. Tom Lane <tgl@sss.pgh.pa.us> 2021-08-31 17:54 pgsql: Cache the results of format_type() queries in pg_dump. Tom Lane <tgl@sss.pgh.pa.us> 2021-08-31 17:54 pgsql: Cache the results of format_type() queries in pg_dump. 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