]> granicus.if.org Git - postgresql/commit
postgres_fdw: Perform the (FINAL, NULL) upperrel operations remotely.
authorEtsuro Fujita <efujita@postgresql.org>
Tue, 2 Apr 2019 11:30:45 +0000 (20:30 +0900)
committerEtsuro Fujita <efujita@postgresql.org>
Tue, 2 Apr 2019 11:30:45 +0000 (20:30 +0900)
commitd50d172e517c1d2aabff3ceb3ad3113b909c5017
tree7a65adb1310d1fa0f08effc93ee75e7558cc8d9f
parentaef65db6769e3f2c855dd89edcf95a536a9ab74f
postgres_fdw: Perform the (FINAL, NULL) upperrel operations remotely.

The upper-planner pathification allows FDWs to arrange to push down
different types of upper-stage operations to the remote side.  This
commit teaches postgres_fdw to do it for the (FINAL, NULL) upperrel,
which is responsible for doing LockRows, LIMIT, and/or ModifyTable.
This provides the ability for postgres_fdw to handle SELECT commands
so that it 1) skips the LockRows step (if any) (note that this is
safe since it performs early locking) and 2) pushes down the LIMIT
and/or OFFSET restrictions (if any) to the remote side.  This doesn't
handle the INSERT/UPDATE/DELETE cases.

Author: Etsuro Fujita
Reviewed-By: Antonin Houska and Jeff Janes
Discussion: https://postgr.es/m/87pnz1aby9.fsf@news-spur.riddles.org.uk
contrib/postgres_fdw/deparse.c
contrib/postgres_fdw/expected/postgres_fdw.out
contrib/postgres_fdw/postgres_fdw.c
contrib/postgres_fdw/postgres_fdw.h
contrib/postgres_fdw/sql/postgres_fdw.sql
src/backend/optimizer/plan/planner.c
src/include/nodes/pathnodes.h