pgsql: Add support for doing late row locking in FDWs.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Add support for doing late row locking in FDWs.
Дата
Msg-id E1YsEdV-0004Xh-AM@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Add support for doing late row locking in FDWs.

Previously, FDWs could only do "early row locking", that is lock a row as
soon as it's fetched, even though local restriction/join conditions might
discard the row later.  This patch adds callbacks that allow FDWs to do
late locking in the same way that it's done for regular tables.

To make use of this feature, an FDW must support the "ctid" column as a
unique row identifier.  Currently, since ctid has to be of type TID,
the feature is of limited use, though in principle it could be used by
postgres_fdw.  We may eventually allow FDWs to specify another data type
for ctid, which would make it possible for more FDWs to use this feature.

This commit does not modify postgres_fdw to use late locking.  We've
tested some prototype code for that, but it's not in committable shape,
and besides it's quite unclear whether it actually makes sense to do late
locking against a remote server.  The extra round trips required are likely
to outweigh any benefit from improved concurrency.

Etsuro Fujita, reviewed by Ashutosh Bapat, and hacked up a lot by me

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/afb9249d06f47d7a6d4a89fea0c3625fe43c5a5d

Modified Files
--------------
doc/src/sgml/fdwhandler.sgml           |  232 +++++++++++++++++++++++++++++---
src/backend/executor/execMain.c        |   79 ++++++++---
src/backend/executor/execUtils.c       |   17 +--
src/backend/executor/nodeLockRows.c    |  133 ++++++++++++------
src/backend/executor/nodeModifyTable.c |    2 +-
src/backend/optimizer/plan/planner.c   |    8 +-
src/include/executor/executor.h        |    2 +-
src/include/foreign/fdwapi.h           |   12 ++
src/include/nodes/execnodes.h          |   12 +-
src/include/nodes/plannodes.h          |   31 +++--
10 files changed, 415 insertions(+), 113 deletions(-)


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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: pgsql: Map basebackup tablespaces using a tablespace_map file
Следующее
От: Andrew Dunstan
Дата:
Сообщение: pgsql: Additional functions and operators for jsonb