forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit83772cc
committed
Free memory after building each statistics object
Until now, all extended statistics on a given relation were built in thesame memory context, without resetting. Some of the memory was releasedexplicitly, but not all of it - for example memory allocated whiledetoasting values is hard to free. This is how it worked since extendedstatistics were introduced in PostgreSQL 10, but adding support forextended stats on expressions made the issue somewhat worse as itincreases the number of statistics to build.Fixed by adding a memory context which gets reset after building eachstatistics object (all the statistics kinds included in it). Resettingit after building each statistics kind would be even better, but itwould require more invasive changes and copying of results, making itharder to backpatch.Backpatch to PostgreSQL 10, where extended statistics were introduced.Author: Justin PryzbyReported-by: Justin PryzbyReviewed-by: Tomas VondraBackpatch-through: 10Discussion:https://www.postgresql.org/message-id/20210915200928.GP831%40telsasoft.com1 parentc7aeb77 commit83772cc
1 file changed
+11
-7
lines changedLines changed: 11 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
125 | 125 |
| |
126 | 126 |
| |
127 | 127 |
| |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
128 | 133 |
| |
129 | 134 |
| |
130 | 135 |
| |
131 | 136 |
| |
132 | 137 |
| |
133 |
| - | |
134 |
| - | |
135 |
| - | |
136 | 138 |
| |
137 | 139 |
| |
138 | 140 |
| |
| |||
234 | 236 |
| |
235 | 237 |
| |
236 | 238 |
| |
237 |
| - | |
238 |
| - | |
| 239 | + | |
| 240 | + | |
239 | 241 |
| |
240 | 242 |
| |
241 |
| - | |
242 |
| - | |
243 | 243 |
| |
244 | 244 |
| |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
245 | 249 |
| |
246 | 250 |
| |
247 | 251 |
| |
|
0 commit comments
Comments
(0)