mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
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
This commit is contained in:
@ -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 */
|
||||
|
Reference in New Issue
Block a user