pgsql: Don't reuse slots between root and partition in ON CONFLICT...

Поиск
Список
Период
Сортировка
От Andres Freund
Тема pgsql: Don't reuse slots between root and partition in ON CONFLICT...
Дата
Msg-id E1h1gJd-0001KF-Sh@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/277cb789836b5ddf81aabb80c2058268c70e2f36

Modified Files
--------------
src/backend/executor/execPartition.c   | 52 ++++++++++++++++++-------
src/backend/executor/nodeModifyTable.c | 70 ++++++++++++----------------------
src/include/nodes/execnodes.h          |  5 +--
3 files changed, 64 insertions(+), 63 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: pgsql: Fix equalfuncs for accessMethod addition in 8586bf7ed8.
Следующее
От: Tom Lane
Дата:
Сообщение: Re: pgsql: tableam: Add pg_dump support.