mirror of
https://github.com/postgres/postgres.git
synced 2026-04-15 14:07:46 -04:00
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 |
||
|---|---|---|
| .. | ||
| po | ||
| t | ||
| .gitignore | ||
| common.c | ||
| compress_io.c | ||
| compress_io.h | ||
| dumputils.c | ||
| dumputils.h | ||
| Makefile | ||
| nls.mk | ||
| parallel.c | ||
| parallel.h | ||
| pg_backup.h | ||
| pg_backup_archiver.c | ||
| pg_backup_archiver.h | ||
| pg_backup_custom.c | ||
| pg_backup_db.c | ||
| pg_backup_db.h | ||
| pg_backup_directory.c | ||
| pg_backup_null.c | ||
| pg_backup_tar.c | ||
| pg_backup_tar.h | ||
| pg_backup_utils.c | ||
| pg_backup_utils.h | ||
| pg_dump.c | ||
| pg_dump.h | ||
| pg_dump_sort.c | ||
| pg_dumpall.c | ||
| pg_restore.c | ||