forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit84ad4b0
committed
Reduce memory usage of targetlist SRFs.
Previously nodeProjectSet only released memory once per input tuple,rather than once per returned tuple. If the computation of anindividual returned tuple requires a lot of memory, that can lead toproblems.Instead change things so that the expression context can be reset onceper output tuple, which requires a new memory context to store SRFarguments in.This is a longstanding issue, but was hard to fix before 9.6, due tothe way tSRFs where evaluated. But it's fairly easy to fix now. Wecould backpatch this into 10, but given there've been fewc omplaintsthat doesn't seem worth the risk so far.Reported-By: Lucas FairchildAuthor: Andres Freund, per discussion with Tom LaneDiscussion:https://postgr.es/m/4514.1507318623@sss.pgh.pa.us1 parent643c27e commit84ad4b0
File tree
4 files changed
+57
-8
lines changed- src
- backend/executor
- include
- executor
- nodes
4 files changed
+57
-8
lines changedLines changed: 28 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
467 | 467 |
| |
468 | 468 |
| |
469 | 469 |
| |
470 |
| - | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
471 | 473 |
| |
472 | 474 |
| |
473 | 475 |
| |
474 | 476 |
| |
475 | 477 |
| |
476 | 478 |
| |
| 479 | + | |
477 | 480 |
| |
478 | 481 |
| |
479 | 482 |
| |
| |||
497 | 500 |
| |
498 | 501 |
| |
499 | 502 |
| |
500 |
| - | |
501 |
| - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
502 | 518 |
| |
503 | 519 |
| |
504 | 520 |
| |
| |||
526 | 542 |
| |
527 | 543 |
| |
528 | 544 |
| |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
529 | 549 |
| |
530 | 550 |
| |
531 | 551 |
| |
532 | 552 |
| |
| 553 | + | |
| 554 | + | |
| 555 | + | |
533 | 556 |
| |
| 557 | + | |
| 558 | + | |
534 | 559 |
| |
535 | 560 |
| |
536 | 561 |
| |
|
Lines changed: 27 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
55 | 62 |
| |
56 | 63 |
| |
57 | 64 |
| |
| |||
66 | 73 |
| |
67 | 74 |
| |
68 | 75 |
| |
69 |
| - | |
70 |
| - | |
71 |
| - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
72 | 81 |
| |
73 |
| - | |
| 82 | + | |
74 | 83 |
| |
75 | 84 |
| |
76 | 85 |
| |
| |||
164 | 173 |
| |
165 | 174 |
| |
166 | 175 |
| |
167 |
| - | |
| 176 | + | |
| 177 | + | |
168 | 178 |
| |
169 | 179 |
| |
170 | 180 |
| |
| |||
291 | 301 |
| |
292 | 302 |
| |
293 | 303 |
| |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
294 | 316 |
| |
295 | 317 |
| |
296 | 318 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
400 | 400 |
| |
401 | 401 |
| |
402 | 402 |
| |
| 403 | + | |
403 | 404 |
| |
404 | 405 |
| |
405 | 406 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
946 | 946 |
| |
947 | 947 |
| |
948 | 948 |
| |
| 949 | + | |
949 | 950 |
| |
950 | 951 |
| |
951 | 952 |
| |
|
0 commit comments
Comments
(0)