pgsql: Allow FDWs to push down quals without breaking EvalPlanQual rech

Поиск
Список
Период
Сортировка
От Robert Haas
Тема pgsql: Allow FDWs to push down quals without breaking EvalPlanQual rech
Дата
Msg-id E1Zmm6v-0005nx-AM@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Allow FDWs to push down quals without breaking EvalPlanQual rechecks.

This fixes a long-standing bug which was discovered while investigating
the interaction between the new join pushdown code and the EvalPlanQual
machinery: if a ForeignScan appears on the inner side of a paramaterized
nestloop, an EPQ recheck would re-return the original tuple even if
it no longer satisfied the pushed-down quals due to changed parameter
values.

This fix adds a new member to ForeignScan and ForeignScanState and a
new argument to make_foreignscan, and requires changes to FDWs which
push down quals to populate that new argument with a list of quals they
have chosen to push down.  Therefore, I'm only back-patching to 9.5,
even though the bug is not new in 9.5.

Etsuro Fujita, reviewed by me and by Kyotaro Horiguchi.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/5fc4c26db5120bd90348b6ee3101fcddfdf54800

Modified Files
--------------
contrib/file_fdw/file_fdw.c             |    3 ++-
contrib/postgres_fdw/postgres_fdw.c     |   14 +++++++++++---
doc/src/sgml/fdwhandler.sgml            |    9 +++++++++
src/backend/executor/nodeForeignscan.c  |   19 +++++++++++++++++--
src/backend/nodes/copyfuncs.c           |    1 +
src/backend/nodes/outfuncs.c            |    1 +
src/backend/nodes/readfuncs.c           |    1 +
src/backend/optimizer/plan/createplan.c |    7 ++++++-
src/backend/optimizer/plan/setrefs.c    |    4 +++-
src/backend/optimizer/plan/subselect.c  |   16 ++++++++++++----
src/include/nodes/execnodes.h           |    1 +
src/include/nodes/plannodes.h           |    6 ++++++
src/include/optimizer/planmain.h        |    2 +-
13 files changed, 71 insertions(+), 13 deletions(-)


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Fix bogus comments
Следующее
От: Robert Haas
Дата:
Сообщение: pgsql: Allow FDWs to push down quals without breaking EvalPlanQual rech