- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit5149dc9
committed
Fix query-lifespan memory leakage in repeatedly executed hash joins.
ExecHashTableCreate allocated some memory that wasn't freed byExecHashTableDestroy, specifically the per-hash-key function information.That's not a huge amount of data, but if one runs a query that repeatsa hash join enough times, it builds up. Fix by arranging for the datain question to be kept in the hashtable's hashCxt instead of leaving it"loose" in the query-lifespan executor context. (This ensures that we'llalso clean up anything that the hash functions allocate in fn_mcxt.)Per report from Amit Khandekar. It's been like this forever, so back-patchto all supported branches.Discussion:https://postgr.es/m/CAJ3gD9cFofAWGvcxLOxDHC=B0hjtW8yGmUsF2hdGh97CM38=7g@mail.gmail.com1 parent02c4ad3 commit5149dc9
1 file changed
+18
-17
lines changedLines changed: 18 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
275 | 275 |
| |
276 | 276 |
| |
277 | 277 |
| |
278 |
| - | |
| 278 | + | |
| 279 | + | |
279 | 280 |
| |
280 | 281 |
| |
281 | 282 |
| |
| |||
312 | 313 |
| |
313 | 314 |
| |
314 | 315 |
| |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
315 | 332 |
| |
316 | 333 |
| |
317 | 334 |
| |
| |||
338 | 355 |
| |
339 | 356 |
| |
340 | 357 |
| |
341 |
| - | |
342 |
| - | |
343 |
| - | |
344 |
| - | |
345 |
| - | |
346 |
| - | |
347 |
| - | |
348 |
| - | |
349 |
| - | |
350 |
| - | |
351 |
| - | |
352 |
| - | |
353 |
| - | |
354 |
| - | |
355 |
| - | |
356 |
| - | |
357 | 358 |
| |
358 | 359 |
| |
359 | 360 |
| |
|
0 commit comments
Comments
(0)