postgresql/src/backend
Andres Freund 277cb78983 Don't reuse slots between root and partition in ON CONFLICT ... UPDATE.
Until now the the slot to store the conflicting tuple, and the result
of the ON CONFLICT SET, where reused between partitions. That
necessitated changing slots descriptor when switching partitions.

Besides the overhead of switching descriptors on a slot (which
requires memory allocations and prevents JITing), that's importantly
also problematic for tableam. There individual partitions might belong
to different tableams, needing different kinds of slots.

In passing also fix ExecOnConflictUpdate to clear the existing slot at
exit. Otherwise that slot could continue to hold a pin till the query
ends, which could be far too long if the input data set is large, and
there's no further conflicts. While previously also problematic, it's
now more important as there will be more such slots when partitioned.

Author: Andres Freund
Reviewed-By: Robert Haas, David Rowley
Discussion: https://postgr.es/m/20180703070645.wchpu5muyto5n647@alap3.anarazel.de
2019-03-06 15:43:33 -08:00
..
access tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
bootstrap tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
catalog tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
commands tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
executor Don't reuse slots between root and partition in ON CONFLICT ... UPDATE. 2019-03-06 15:43:33 -08:00
foreign Update copyright for 2019 2019-01-02 12:44:25 -05:00
jit Renaming for new subscripting mechanism 2019-02-01 12:50:32 -03:00
lib Make use of compiler builtins and/or assembly for CLZ, CTZ, POPCNT. 2019-02-15 23:22:33 -05:00
libpq Get rid of another unconstify through API changes 2019-02-14 20:44:47 +01:00
main Replace @postgresql.org with @lists.postgresql.org for mailinglists 2019-01-19 19:06:35 +01:00
nodes Fix equalfuncs for accessMethod addition in 8586bf7ed8. 2019-03-06 13:04:09 -08:00
optimizer Teach optimizer's predtest.c more things about ScalarArrayOpExpr. 2019-03-01 17:14:17 -05:00
parser tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
partitioning Move code for managing PartitionDescs into a new file, partdesc.c 2019-02-21 11:45:02 -05:00
po Translation updates 2018-06-25 12:37:18 +02:00
port Add shared_memory_type GUC. 2019-02-03 12:47:26 +01:00
postmaster Don't log incomplete startup packet if it's empty 2019-03-06 15:36:41 -05:00
regex Update copyright for 2019 2019-01-02 12:44:25 -05:00
replication Use a virtual rather than a heap slot in two places where that suffices. 2019-03-01 17:26:43 -08:00
rewrite tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
snowball Update copyright for 2019 2019-01-02 12:44:25 -05:00
statistics Rename nodes/relation.h to nodes/pathnodes.h. 2019-01-29 16:49:25 -05:00
storage Remove volatile from latch API 2019-03-04 11:30:41 +01:00
tcop More unconstify use 2019-02-13 11:50:16 +01:00
tsearch Update copyright for 2019 2019-01-02 12:44:25 -05:00
utils tableam: introduce table AM infrastructure. 2019-03-06 09:54:38 -08:00
.gitignore Add .gitignore entries for AIX-specific intermediate build artifacts. 2015-07-08 20:44:22 -04:00
common.mk Remove PARTIAL_LINKING build mode. 2018-03-30 17:33:04 -07:00
Makefile Ensure link commands list *.o files before LDFLAGS. 2019-01-02 13:57:54 -05:00
nls.mk Translation updates 2018-06-25 12:37:18 +02:00