- Notifications
You must be signed in to change notification settings - Fork5
Commit6a0865e
committed
In a non-hashed Agg node, reset the "aggcontext" at group boundaries, instead
of individually pfree'ing pass-by-reference transition values. This shouldbe at least as fast as the prior coding, and it has the major advantage ofclearing out any working data an aggregate function may have stored in orunderneath the aggcontext. This avoids memory leakage when an aggregatesuch as array_agg() is used in GROUP BY mode. Per report from Chris Spotts.Back-patch to 8.4. In principle the problem could arise in prior versions,but since they didn't have array_agg the issue seems not critical.1 parent1ca695d commit6a0865e
2 files changed
+15
-17
lines changedLines changed: 11 additions & 15 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
55 | 55 |
| |
56 | 56 |
| |
57 | 57 |
| |
| 58 | + | |
| 59 | + | |
58 | 60 |
| |
59 | 61 |
| |
60 | 62 |
| |
61 | 63 |
| |
62 | 64 |
| |
63 | 65 |
| |
64 |
| - | |
| 66 | + | |
65 | 67 |
| |
66 | 68 |
| |
67 | 69 |
| |
| |||
272 | 274 |
| |
273 | 275 |
| |
274 | 276 |
| |
275 |
| - | |
276 |
| - | |
277 |
| - | |
278 |
| - | |
279 |
| - | |
280 |
| - | |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
286 |
| - | |
287 | 277 |
| |
288 | 278 |
| |
289 | 279 |
| |
| |||
911 | 901 |
| |
912 | 902 |
| |
913 | 903 |
| |
914 |
| - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
915 | 908 |
| |
916 | 909 |
| |
917 | 910 |
| |
| 911 | + | |
| 912 | + | |
918 | 913 |
| |
919 | 914 |
| |
920 | 915 |
| |
| |||
1234 | 1229 |
| |
1235 | 1230 |
| |
1236 | 1231 |
| |
1237 |
| - | |
| 1232 | + | |
| 1233 | + | |
1238 | 1234 |
| |
1239 | 1235 |
| |
1240 | 1236 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6 | 6 |
| |
7 | 7 |
| |
8 | 8 |
| |
9 |
| - | |
| 9 | + | |
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
| |||
539 | 539 |
| |
540 | 540 |
| |
541 | 541 |
| |
542 |
| - | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
543 | 545 |
| |
544 | 546 |
| |
545 | 547 |
| |
|
0 commit comments
Comments
(0)