forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6c450a8
committed
Cache the results of format_type() queries in pg_dump.
There's long been a "TODO: there might be some value in cachingthe results" annotation on pg_dump's getFormattedTypeName function;but we hadn't gotten around to checking what it was costing us torepetitively look up type names. It turns out that when dumping thecurrent regression database, about 10% of the total number of queriesissued are duplicative format_type() queries. However, Hubert DepeszLubaczewski reported a not-unusual case where these account for overhalf of the queries issued by pg_dump. Individually these queriesaren't expensive, but when network lag is a factor, they add up to aproblem. We can very easily add some caching to getFormattedTypeNameto solve it.Since this is such a simple fix and can have a visible performancebenefit, back-patch to all supported branches.Discussion:https://postgr.es/m/20210826084430.GA26282@depesz.com1 parent628bc9d commit6c450a8
2 files changed
+15
-4
lines changedLines changed: 11 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5232 | 5232 |
| |
5233 | 5233 |
| |
5234 | 5234 |
| |
| 5235 | + | |
5235 | 5236 |
| |
5236 | 5237 |
| |
5237 | 5238 |
| |
| |||
18892 | 18893 |
| |
18893 | 18894 |
| |
18894 | 18895 |
| |
18895 |
| - | |
18896 |
| - | |
18897 | 18896 |
| |
18898 | 18897 |
| |
18899 | 18898 |
| |
18900 | 18899 |
| |
| 18900 | + | |
18901 | 18901 |
| |
18902 | 18902 |
| |
18903 | 18903 |
| |
| |||
18910 | 18910 |
| |
18911 | 18911 |
| |
18912 | 18912 |
| |
| 18913 | + | |
| 18914 | + | |
| 18915 | + | |
| 18916 | + | |
| 18917 | + | |
18913 | 18918 |
| |
18914 | 18919 |
| |
18915 | 18920 |
| |
| |||
18922 | 18927 |
| |
18923 | 18928 |
| |
18924 | 18929 |
| |
| 18930 | + | |
| 18931 | + | |
| 18932 | + | |
| 18933 | + | |
18925 | 18934 |
| |
18926 | 18935 |
| |
18927 | 18936 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
166 | 166 |
| |
167 | 167 |
| |
168 | 168 |
| |
169 |
| - | |
170 |
| - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
171 | 172 |
| |
| 173 | + | |
172 | 174 |
| |
173 | 175 |
| |
174 | 176 |
| |
|
0 commit comments
Comments
(0)