postgresql/src/include/nodes
Tomas Vondra b676ac443b Optimize creation of slots for FDW bulk inserts
Commit b663a41363 introduced bulk inserts for FDW, but the handling of
tuple slots turned out to be problematic for two reasons. Firstly, the
slots were re-created for each individual batch. Secondly, all slots
referenced the same tuple descriptor - with reasonably small batches
this 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 times
a slot has to be created/dropped, larger batches are needed. However,
the larger the batch, the more expensive the resource owner gets. For
practical batch sizes (100 - 1000) this would not be a big problem, as
the benefits (latency savings) greatly exceed the resource owner costs.
But for extremely large batches it might be much worse, possibly even
losing with non-batching mode.

Fixed by initializing tuple slots only once (and reusing them across
batches) and by using a new tuple descriptor copy for each slot.

Discussion: https://postgr.es/m/ebbbcc7d-4286-8c28-0272-61b4753af761%40enterprisedb.com
2021-06-11 20:23:33 +02:00
..
bitmapset.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
execnodes.h Optimize creation of slots for FDW bulk inserts 2021-06-11 20:23:33 +02:00
extensible.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
lockoptions.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
makefuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
memnodes.h Add function to log the memory contexts of specified backend process. 2021-04-06 13:44:15 +09:00
nodeFuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
nodes.h SQL-standard function body 2021-04-07 21:47:55 +02:00
params.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
parsenodes.h Change position of field "transformed" in struct CreateStatsStmt. 2021-06-10 21:56:14 -07:00
pathnodes.h Initial pgindent and pgperltidy run for v14. 2021-05-12 13:14:10 -04:00
pg_list.h Implement GROUP BY DISTINCT 2021-03-18 18:22:18 +01:00
plannodes.h Update plannodes.h's comments about PlanRowMark. 2021-06-02 11:52:35 -04:00
primnodes.h Speedup ScalarArrayOpExpr evaluation 2021-04-08 23:51:22 +12:00
print.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
readfuncs.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
replnodes.h Remove two_phase variable from CreateReplicationSlotCmd struct. 2021-06-07 09:32:06 +05:30
subscripting.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
supportnodes.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
tidbitmap.h Update copyright for 2021 2021-01-02 13:06:25 -05:00
value.h Update copyright for 2021 2021-01-02 13:06:25 -05:00