forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb676ac4
committed
Optimize creation of slots for FDW bulk inserts
Commitb663a41 introduced bulk inserts for FDW, but the handling oftuple slots turned out to be problematic for two reasons. Firstly, theslots were re-created for each individual batch. Secondly, all slotsreferenced the same tuple descriptor - with reasonably small batchesthis is not an issue, but with large batches this triggers O(N^2)behavior in the resource owner code.These two issues work against each other - to reduce the number of timesa slot has to be created/dropped, larger batches are needed. However,the larger the batch, the more expensive the resource owner gets. Forpractical batch sizes (100 - 1000) this would not be a big problem, asthe benefits (latency savings) greatly exceed the resource owner costs.But for extremely large batches it might be much worse, possibly evenlosing with non-batching mode.Fixed by initializing tuple slots only once (and reusing them acrossbatches) and by using a new tuple descriptor copy for each slot.Discussion:https://postgr.es/m/ebbbcc7d-4286-8c28-0272-61b4753af761%40enterprisedb.com1 parent96540f8 commitb676ac4
File tree
2 files changed
+37
-16
lines changed- src
- backend/executor
- include/nodes
2 files changed
+37
-16
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
703 | 703 |
| |
704 | 704 |
| |
705 | 705 |
| |
706 |
| - | |
707 |
| - | |
708 |
| - | |
709 |
| - | |
710 |
| - | |
711 |
| - | |
712 |
| - | |
713 |
| - | |
714 |
| - | |
715 |
| - | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
716 | 731 |
| |
717 | 732 |
| |
718 | 733 |
| |
| |||
1034 | 1049 |
| |
1035 | 1050 |
| |
1036 | 1051 |
| |
1037 |
| - | |
1038 |
| - | |
1039 |
| - | |
1040 |
| - | |
1041 |
| - | |
1042 |
| - | |
1043 | 1052 |
| |
1044 | 1053 |
| |
1045 | 1054 |
| |
| |||
3162 | 3171 |
| |
3163 | 3172 |
| |
3164 | 3173 |
| |
| 3174 | + | |
3165 | 3175 |
| |
3166 | 3176 |
| |
3167 | 3177 |
| |
3168 | 3178 |
| |
3169 | 3179 |
| |
3170 | 3180 |
| |
3171 | 3181 |
| |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
3172 | 3192 |
| |
3173 | 3193 |
| |
3174 | 3194 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
462 | 462 |
| |
463 | 463 |
| |
464 | 464 |
| |
| 465 | + | |
465 | 466 |
| |
466 | 467 |
| |
467 | 468 |
| |
|
0 commit comments
Comments
(0)