aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/plan')
-rw-r--r--src/backend/optimizer/plan/createplan.c49
-rw-r--r--src/backend/optimizer/plan/initsplan.c18
-rw-r--r--src/backend/optimizer/plan/setrefs.c14
-rw-r--r--src/backend/optimizer/plan/subselect.c4
4 files changed, 41 insertions, 44 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 439e6b6426c..92dd322c622 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -92,9 +92,8 @@ static Result *create_group_result_plan(PlannerInfo *root,
static ProjectSet *create_project_set_plan(PlannerInfo *root, ProjectSetPath *best_path);
static Material *create_material_plan(PlannerInfo *root, MaterialPath *best_path,
int flags);
-static ResultCache *create_resultcache_plan(PlannerInfo *root,
- ResultCachePath *best_path,
- int flags);
+static Memoize *create_memoize_plan(PlannerInfo *root, MemoizePath *best_path,
+ int flags);
static Plan *create_unique_plan(PlannerInfo *root, UniquePath *best_path,
int flags);
static Gather *create_gather_plan(PlannerInfo *root, GatherPath *best_path);
@@ -278,11 +277,9 @@ static Sort *make_sort_from_groupcols(List *groupcls,
AttrNumber *grpColIdx,
Plan *lefttree);
static Material *make_material(Plan *lefttree);
-static ResultCache *make_resultcache(Plan *lefttree, Oid *hashoperators,
- Oid *collations,
- List *param_exprs,
- bool singlerow,
- uint32 est_entries);
+static Memoize *make_memoize(Plan *lefttree, Oid *hashoperators,
+ Oid *collations, List *param_exprs,
+ bool singlerow, uint32 est_entries);
static WindowAgg *make_windowagg(List *tlist, Index winref,
int partNumCols, AttrNumber *partColIdx, Oid *partOperators, Oid *partCollations,
int ordNumCols, AttrNumber *ordColIdx, Oid *ordOperators, Oid *ordCollations,
@@ -459,10 +456,10 @@ create_plan_recurse(PlannerInfo *root, Path *best_path, int flags)
(MaterialPath *) best_path,
flags);
break;
- case T_ResultCache:
- plan = (Plan *) create_resultcache_plan(root,
- (ResultCachePath *) best_path,
- flags);
+ case T_Memoize:
+ plan = (Plan *) create_memoize_plan(root,
+ (MemoizePath *) best_path,
+ flags);
break;
case T_Unique:
if (IsA(best_path, UpperUniquePath))
@@ -1578,16 +1575,16 @@ create_material_plan(PlannerInfo *root, MaterialPath *best_path, int flags)
}
/*
- * create_resultcache_plan
- * Create a ResultCache plan for 'best_path' and (recursively) plans
- * for its subpaths.
+ * create_memoize_plan
+ * Create a Memoize plan for 'best_path' and (recursively) plans for its
+ * subpaths.
*
* Returns a Plan node.
*/
-static ResultCache *
-create_resultcache_plan(PlannerInfo *root, ResultCachePath *best_path, int flags)
+static Memoize *
+create_memoize_plan(PlannerInfo *root, MemoizePath *best_path, int flags)
{
- ResultCache *plan;
+ Memoize *plan;
Plan *subplan;
Oid *operators;
Oid *collations;
@@ -1619,8 +1616,8 @@ create_resultcache_plan(PlannerInfo *root, ResultCachePath *best_path, int flags
i++;
}
- plan = make_resultcache(subplan, operators, collations, param_exprs,
- best_path->singlerow, best_path->est_entries);
+ plan = make_memoize(subplan, operators, collations, param_exprs,
+ best_path->singlerow, best_path->est_entries);
copy_generic_path_info(&plan->plan, (Path *) best_path);
@@ -6417,11 +6414,11 @@ materialize_finished_plan(Plan *subplan)
return matplan;
}
-static ResultCache *
-make_resultcache(Plan *lefttree, Oid *hashoperators, Oid *collations,
- List *param_exprs, bool singlerow, uint32 est_entries)
+static Memoize *
+make_memoize(Plan *lefttree, Oid *hashoperators, Oid *collations,
+ List *param_exprs, bool singlerow, uint32 est_entries)
{
- ResultCache *node = makeNode(ResultCache);
+ Memoize *node = makeNode(Memoize);
Plan *plan = &node->plan;
plan->targetlist = lefttree->targetlist;
@@ -7035,7 +7032,7 @@ is_projection_capable_path(Path *path)
{
case T_Hash:
case T_Material:
- case T_ResultCache:
+ case T_Memoize:
case T_Sort:
case T_IncrementalSort:
case T_Unique:
@@ -7081,7 +7078,7 @@ is_projection_capable_plan(Plan *plan)
{
case T_Hash:
case T_Material:
- case T_ResultCache:
+ case T_Memoize:
case T_Sort:
case T_Unique:
case T_SetOp:
diff --git a/src/backend/optimizer/plan/initsplan.c b/src/backend/optimizer/plan/initsplan.c
index 3ac853d9efc..e25dc9a7ca7 100644
--- a/src/backend/optimizer/plan/initsplan.c
+++ b/src/backend/optimizer/plan/initsplan.c
@@ -78,7 +78,7 @@ static bool check_equivalence_delay(PlannerInfo *root,
static bool check_redundant_nullability_qual(PlannerInfo *root, Node *clause);
static void check_mergejoinable(RestrictInfo *restrictinfo);
static void check_hashjoinable(RestrictInfo *restrictinfo);
-static void check_resultcacheable(RestrictInfo *restrictinfo);
+static void check_memoizable(RestrictInfo *restrictinfo);
/*****************************************************************************
@@ -2212,10 +2212,10 @@ distribute_restrictinfo_to_rels(PlannerInfo *root,
/*
* Likewise, check if the clause is suitable to be used with a
- * Result Cache node to cache inner tuples during a parameterized
+ * Memoize node to cache inner tuples during a parameterized
* nested loop.
*/
- check_resultcacheable(restrictinfo);
+ check_memoizable(restrictinfo);
/*
* Add clause to the join lists of all the relevant relations.
@@ -2459,7 +2459,7 @@ build_implied_join_equality(PlannerInfo *root,
/* Set mergejoinability/hashjoinability flags */
check_mergejoinable(restrictinfo);
check_hashjoinable(restrictinfo);
- check_resultcacheable(restrictinfo);
+ check_memoizable(restrictinfo);
return restrictinfo;
}
@@ -2709,13 +2709,13 @@ check_hashjoinable(RestrictInfo *restrictinfo)
}
/*
- * check_resultcacheable
- * If the restrictinfo's clause is suitable to be used for a Result Cache
- * node, set the hasheqoperator to the hash equality operator that will be
- * needed during caching.
+ * check_memoizable
+ * If the restrictinfo's clause is suitable to be used for a Memoize node,
+ * set the hasheqoperator to the hash equality operator that will be needed
+ * during caching.
*/
static void
-check_resultcacheable(RestrictInfo *restrictinfo)
+check_memoizable(RestrictInfo *restrictinfo)
{
TypeCacheEntry *typentry;
Expr *clause = restrictinfo->clause;
diff --git a/src/backend/optimizer/plan/setrefs.c b/src/backend/optimizer/plan/setrefs.c
index 61ccfd300b3..82538539e07 100644
--- a/src/backend/optimizer/plan/setrefs.c
+++ b/src/backend/optimizer/plan/setrefs.c
@@ -752,19 +752,19 @@ set_plan_refs(PlannerInfo *root, Plan *plan, int rtoffset)
set_hash_references(root, plan, rtoffset);
break;
- case T_ResultCache:
+ case T_Memoize:
{
- ResultCache *rcplan = (ResultCache *) plan;
+ Memoize *mplan = (Memoize *) plan;
/*
- * Result Cache does not evaluate its targetlist. It just
- * uses the same targetlist from its outer subnode.
+ * Memoize does not evaluate its targetlist. It just uses the
+ * same targetlist from its outer subnode.
*/
set_dummy_tlist_references(plan, rtoffset);
- rcplan->param_exprs = fix_scan_list(root, rcplan->param_exprs,
- rtoffset,
- NUM_EXEC_TLIST(plan));
+ mplan->param_exprs = fix_scan_list(root, mplan->param_exprs,
+ rtoffset,
+ NUM_EXEC_TLIST(plan));
break;
}
diff --git a/src/backend/optimizer/plan/subselect.c b/src/backend/optimizer/plan/subselect.c
index 0881a208acf..b5a61f39335 100644
--- a/src/backend/optimizer/plan/subselect.c
+++ b/src/backend/optimizer/plan/subselect.c
@@ -2745,8 +2745,8 @@ finalize_plan(PlannerInfo *root, Plan *plan,
/* rescan_param does *not* get added to scan_params */
break;
- case T_ResultCache:
- finalize_primnode((Node *) ((ResultCache *) plan)->param_exprs,
+ case T_Memoize:
+ finalize_primnode((Node *) ((Memoize *) plan)->param_exprs,
&context);
break;