pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Allow foreign and custom joins to handle EvalPlanQual rechecks.
2+ messages / 1 participants
[nested] [flat]

* pgsql: Allow foreign and custom joins to handle EvalPlanQual rechecks.
@ 2015-12-08 17:54 Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2015-12-08 17:54 UTC (permalink / raw)
  To: pgsql-committers

Allow foreign and custom joins to handle EvalPlanQual rechecks.

Commit e7cb7ee14555cc9c5773e2c102efd6371f6f2005 provided basic
infrastructure for allowing a foreign data wrapper or custom scan
provider to replace a join of one or more tables with a scan.
However, this infrastructure failed to take into account the need
for possible EvalPlanQual rechecks, and ExecScanFetch would fail
an assertion (or just overwrite memory) if such a check was attempted
for a plan containing a pushed-down join.  To fix, adjust the EPQ
machinery to skip some processing steps when scanrelid == 0, making
those the responsibility of scan's recheck method, which also has
the responsibility in this case of correctly populating the relevant
slot.

To allow foreign scans to gain control in the right place to make
use of this new facility, add a new, optional RecheckForeignScan
method.  Also, allow a foreign scan to have a child plan, which can
be used to correctly populate the slot (or perhaps for something
else, but this is the only use currently envisioned).

KaiGai Kohei, reviewed by Robert Haas, Etsuro Fujita, and Kyotaro
Horiguchi.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/385f337c9f39b21dca96ca4770552a10a6d5af24

Modified Files
--------------
contrib/file_fdw/file_fdw.c             |   10 ++++---
contrib/postgres_fdw/postgres_fdw.c     |   12 ++++++---
doc/src/sgml/fdwhandler.sgml            |   42 ++++++++++++++++++++++++++---
src/backend/executor/execScan.c         |   44 ++++++++++++++++++++++++++++---
src/backend/executor/nodeForeignscan.c  |   32 ++++++++++++++++++++++
src/backend/nodes/outfuncs.c            |    1 +
src/backend/optimizer/plan/createplan.c |   13 ++++++---
src/backend/optimizer/util/pathnode.c   |    2 ++
src/include/foreign/fdwapi.h            |    7 ++++-
src/include/nodes/relation.h            |    1 +
src/include/optimizer/pathnode.h        |    1 +
src/include/optimizer/planmain.h        |    3 ++-
12 files changed, 150 insertions(+), 18 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Allow foreign and custom joins to handle EvalPlanQual rechecks.
@ 2015-12-08 17:54 Robert Haas <rhaas@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Robert Haas @ 2015-12-08 17:54 UTC (permalink / raw)
  To: pgsql-committers

Allow foreign and custom joins to handle EvalPlanQual rechecks.

Commit e7cb7ee14555cc9c5773e2c102efd6371f6f2005 provided basic
infrastructure for allowing a foreign data wrapper or custom scan
provider to replace a join of one or more tables with a scan.
However, this infrastructure failed to take into account the need
for possible EvalPlanQual rechecks, and ExecScanFetch would fail
an assertion (or just overwrite memory) if such a check was attempted
for a plan containing a pushed-down join.  To fix, adjust the EPQ
machinery to skip some processing steps when scanrelid == 0, making
those the responsibility of scan's recheck method, which also has
the responsibility in this case of correctly populating the relevant
slot.

To allow foreign scans to gain control in the right place to make
use of this new facility, add a new, optional RecheckForeignScan
method.  Also, allow a foreign scan to have a child plan, which can
be used to correctly populate the slot (or perhaps for something
else, but this is the only use currently envisioned).

KaiGai Kohei, reviewed by Robert Haas, Etsuro Fujita, and Kyotaro
Horiguchi.

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/325b357bc255149c5ace7d77f5c15c941bafef0a

Modified Files
--------------
contrib/file_fdw/file_fdw.c             |   10 ++++---
contrib/postgres_fdw/postgres_fdw.c     |   11 +++++---
doc/src/sgml/fdwhandler.sgml            |   42 ++++++++++++++++++++++++++---
src/backend/executor/execScan.c         |   44 ++++++++++++++++++++++++++++---
src/backend/executor/nodeForeignscan.c  |   32 ++++++++++++++++++++++
src/backend/nodes/outfuncs.c            |    1 +
src/backend/optimizer/plan/createplan.c |   13 ++++++---
src/backend/optimizer/util/pathnode.c   |    2 ++
src/include/foreign/fdwapi.h            |    7 ++++-
src/include/nodes/relation.h            |    1 +
src/include/optimizer/pathnode.h        |    1 +
src/include/optimizer/planmain.h        |    3 ++-
12 files changed, 149 insertions(+), 18 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2015-12-08 17:54 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08 17:54 pgsql: Allow foreign and custom joins to handle EvalPlanQual rechecks. Robert Haas <rhaas@postgresql.org>
2015-12-08 17:54 pgsql: Allow foreign and custom joins to handle EvalPlanQual rechecks. Robert Haas <rhaas@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox