aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-03-16 13:34:59 -0400
committerRobert Haas <rhaas@postgresql.org>2017-03-16 13:34:59 -0400
commitb30fb56b07a885f3476fe05920249f4832ca8da5 (patch)
tree9cd61df6b4b83556a935fc52106b958201c17ad7 /contrib/postgres_fdw/postgres_fdw.h
parenta3eac988c26706059ae74c740a1abcb588449abe (diff)
downloadpostgresql-b30fb56b07a885f3476fe05920249f4832ca8da5.tar.gz
postgresql-b30fb56b07a885f3476fe05920249f4832ca8da5.zip
postgres_fdw: Push down FULL JOINs with restriction clauses.
The previous deparsing logic wasn't smart enough to produce subqueries when deparsing; make it smart enough to do that. However, we only do it that way when necessary, because it generates more complicated SQL which will be harder for any humans reading the queries to understand. Etsuro Fujita, reviewed by Ashutosh Bapat Discussion: http://postgr.es/m/c449261a-b033-dc02-9254-2fe5b7044795@lab.ntt.co.jp
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.h')
-rw-r--r--contrib/postgres_fdw/postgres_fdw.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.h b/contrib/postgres_fdw/postgres_fdw.h
index 46cac55e98a..57dbb798fdb 100644
--- a/contrib/postgres_fdw/postgres_fdw.h
+++ b/contrib/postgres_fdw/postgres_fdw.h
@@ -95,6 +95,20 @@ typedef struct PgFdwRelationInfo
/* Grouping information */
List *grouped_tlist;
+
+ /* Subquery information */
+ bool make_outerrel_subquery; /* do we deparse outerrel as a
+ * subquery? */
+ bool make_innerrel_subquery; /* do we deparse innerrel as a
+ * subquery? */
+ Relids lower_subquery_rels; /* all relids appearing in lower
+ * subqueries */
+
+ /*
+ * Index of the relation. It is used to create an alias to a subquery
+ * representing the relation.
+ */
+ int relation_index;
} PgFdwRelationInfo;
/* in postgres_fdw.c */
@@ -161,7 +175,7 @@ extern Expr *find_em_expr_for_rel(EquivalenceClass *ec, RelOptInfo *rel);
extern List *build_tlist_to_deparse(RelOptInfo *foreignrel);
extern void deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root,
RelOptInfo *foreignrel, List *tlist,
- List *remote_conds, List *pathkeys,
+ List *remote_conds, List *pathkeys, bool is_subquery,
List **retrieved_attrs, List **params_list);
/* in shippable.c */