support cross apply
This commit is contained in:
@ -158,6 +158,7 @@ extern const uint32 PARTITION_NAME_VERSION_NUM;
|
||||
extern const uint32 OBJECT_TYPE_VERSION_NUM;
|
||||
extern const uint32 MINMAXEXPR_CMPTYPE_VERSION_NUM;
|
||||
extern const uint32 CHARBYTE_SEMANTIC_VERSION_NUMBER;
|
||||
extern const uint32 APPLY_JOIN_VERSION_NUMBER;
|
||||
|
||||
extern void register_backend_version(uint32 backend_version);
|
||||
extern bool contain_backend_version(uint32 version_number);
|
||||
|
||||
@ -400,6 +400,21 @@ extern List* list_insert_nth_oid(List *list, int pos, Oid datum);
|
||||
|
||||
#define listCopy(list) list_copy(list)
|
||||
|
||||
|
||||
/*
|
||||
* foreach_delete_current -
|
||||
* delete the current list element from the List associated with a
|
||||
* surrounding foreach() loop, returning the new List pointer.
|
||||
*
|
||||
* This is equivalent to list_delete_cell(), but it also adjusts the foreach
|
||||
* loop's state so that no list elements will be missed. Do not delete
|
||||
* elements from an active foreach loop's list in any other way!
|
||||
*/
|
||||
#define foreach_delete_current(lst, cell) \
|
||||
(cell##__state.i--, \
|
||||
(List *) (cell##__state.l = list_delete_cell(lst, cell)))
|
||||
|
||||
|
||||
extern int length(List* list);
|
||||
#endif /* ENABLE_LIST_COMPAT */
|
||||
|
||||
|
||||
@ -1415,6 +1415,7 @@ typedef struct JoinExpr {
|
||||
Alias* alias; /* user-written alias clause, if any */
|
||||
int rtindex; /* RT index assigned for join, or 0 */
|
||||
bool is_straight_join; /* set true if straight_join */
|
||||
bool is_apply_join; /* set true when on cross apply or outer apply join */
|
||||
} JoinExpr;
|
||||
|
||||
/* ----------
|
||||
|
||||
@ -781,6 +781,11 @@ typedef struct RelOptInfo {
|
||||
struct Path* cheapest_unique_path;
|
||||
List* cheapest_parameterized_paths;
|
||||
|
||||
|
||||
/* parameterization information needed for both base rels and join rels */
|
||||
/* (see also lateral_vars and lateral_referencers) */
|
||||
Relids direct_lateral_relids; /* rels directly laterally referenced */
|
||||
|
||||
/* information about a base rel (not set for join rels!) */
|
||||
Index relid;
|
||||
Oid reltablespace; /* containing tablespace */
|
||||
@ -791,6 +796,7 @@ typedef struct RelOptInfo {
|
||||
int32* attr_widths; /* array indexed [min_attr .. max_attr] */
|
||||
List* lateral_vars; /* LATERAL Vars and PHVs referenced by rel */
|
||||
Relids lateral_relids; /* minimum parameterization of rel */
|
||||
Relids lateral_referencers; /* rels that reference me laterally */
|
||||
List* indexlist; /* list of IndexOptInfo */
|
||||
|
||||
#ifndef ENABLE_MULTIPLE_NODES
|
||||
@ -1977,9 +1983,9 @@ typedef struct SpecialJoinInfo {
|
||||
*/
|
||||
typedef struct LateralJoinInfo
|
||||
{
|
||||
NodeTag type;
|
||||
Index lateral_rhs; /* a baserel containing lateral refs */
|
||||
Relids lateral_lhs; /* some base relids it references */
|
||||
NodeTag type;
|
||||
Relids lateral_lhs; /* some base relids it references */
|
||||
Relids lateral_rhs; /* some base relids it references */
|
||||
} LateralJoinInfo;
|
||||
|
||||
|
||||
@ -2099,6 +2105,7 @@ typedef struct PlaceHolderInfo {
|
||||
Index phid; /* ID for PH (unique within planner run) */
|
||||
PlaceHolderVar* ph_var; /* copy of PlaceHolderVar tree */
|
||||
Relids ph_eval_at; /* lowest level we can evaluate value at */
|
||||
Relids ph_lateral; /* relids of contained lateral refs, if any */
|
||||
Relids ph_needed; /* highest level the value is needed at */
|
||||
int32 ph_width; /* estimated attribute width */
|
||||
} PlaceHolderInfo;
|
||||
|
||||
@ -67,7 +67,7 @@ extern Plan* optimize_minmax_aggregates(
|
||||
*/
|
||||
extern void set_plan_rows(Plan* plan, double globalRows, double multiple = 1.0);
|
||||
extern Plan* create_plan(PlannerInfo* root, Path* best_path);
|
||||
extern void disuse_physical_tlist(Plan* plan, Path* path);
|
||||
extern void disuse_physical_tlist(PlannerInfo *root, Plan* plan, Path* path);
|
||||
extern void copy_plan_costsize(Plan* dest, Plan* src);
|
||||
extern SubqueryScan* make_subqueryscan(List* qptlist, List* qpqual, Index scanrelid, Plan* subplan);
|
||||
extern ForeignScan* make_foreignscan(List* qptlist, List* qpqual, Index scanrelid, List* fdw_exprs, List* fdw_private,
|
||||
@ -157,7 +157,7 @@ extern void build_base_rel_tlists(PlannerInfo* root, List* final_tlist);
|
||||
extern void add_vars_to_targetlist(PlannerInfo* root, List* vars, Relids where_needed, bool create_new_ph);
|
||||
extern void find_lateral_references(PlannerInfo *root);
|
||||
extern void create_lateral_join_info(PlannerInfo *root);
|
||||
extern void add_lateral_info(PlannerInfo *root, Index rhs, Relids lhs);
|
||||
extern void add_lateral_info(PlannerInfo *root, Relids lhs, Relids rhs);
|
||||
extern List* deconstruct_jointree(PlannerInfo* root, Relids* non_keypreserved = NULL);
|
||||
extern void distribute_restrictinfo_to_rels(PlannerInfo* root, RestrictInfo* restrictinfo);
|
||||
extern void process_security_clause_appendrel(PlannerInfo *root);
|
||||
|
||||
@ -29,7 +29,7 @@ extern List* get_actual_clauses(List* restrictinfo_list);
|
||||
extern List* get_all_actual_clauses(List* restrictinfo_list);
|
||||
extern List* extract_actual_clauses(List* restrictinfo_list, bool pseudoconstant);
|
||||
extern void extract_actual_join_clauses(List* restrictinfo_list, List** joinquals, List** otherquals);
|
||||
extern bool join_clause_is_movable_to(RestrictInfo* rinfo, Index baserelid);
|
||||
extern bool join_clause_is_movable_to(RestrictInfo* rinfo, RelOptInfo *baserel);
|
||||
extern bool join_clause_is_movable_into(RestrictInfo* rinfo, Relids currentrelids, Relids current_and_outer);
|
||||
extern void initialize_bucket_size(RestrictInfo* info);
|
||||
#endif /* RESTRICTINFO_H */
|
||||
|
||||
@ -47,6 +47,7 @@ PG_KEYWORD("and", AND, RESERVED_KEYWORD)
|
||||
PG_KEYWORD("any", ANY, RESERVED_KEYWORD)
|
||||
PG_KEYWORD("app", APP, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("append", APPEND, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("apply", APPLY, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("archive", ARCHIVE, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("array", ARRAY, RESERVED_KEYWORD)
|
||||
PG_KEYWORD("as", AS, RESERVED_KEYWORD)
|
||||
@ -359,6 +360,7 @@ PG_KEYWORD("label", LABEL, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("language", LANGUAGE, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("large", LARGE_P, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("last", LAST_P, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("lateral", LATERAL_P, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("lc_collate", LC_COLLATE_P, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("lc_ctype", LC_CTYPE_P, UNRESERVED_KEYWORD)
|
||||
PG_KEYWORD("leading", LEADING, RESERVED_KEYWORD)
|
||||
|
||||
Reference in New Issue
Block a user