summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan/createplan.c
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2021-07-14 12:45:00 +1200
committerDavid Rowley <drowley@postgresql.org>2021-07-14 12:45:00 +1200
commit47ca4836441d1c24f75a94d43af8bd72d4c8d057 (patch)
treec04f184de05c3439eb2579fd6e4f27bebbd6402e /src/backend/optimizer/plan/createplan.c
parent6201fa3c166fe2383dd44a9dd5082bc748c2937a (diff)
Change the name of the Result Cache node to Memoize
"Result Cache" was never a great name for this node, but nobody managed to come up with another name that anyone liked enough. That was until David Johnston mentioned "Node Memoization", which Tom Lane revised to just "Memoize". People seem to like "Memoize", so let's do the rename. Reviewed-by: Justin Pryzby Discussion: https://postgr.es/m/20210708165145.GG1176@momjian.us Backpatch-through: 14, where Result Cache was introduced
Diffstat (limited to 'src/backend/optimizer/plan/createplan.c')
-rw-r--r--src/backend/optimizer/plan/createplan.c49
1 files changed, 23 insertions, 26 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: