diff options
| author | David Rowley | 2021-07-14 00:43:58 +0000 |
|---|---|---|
| committer | David Rowley | 2021-07-14 00:43:58 +0000 |
| commit | 83f4fcc65503c5d4e5d5eefc8e7a70d3c9a6496f (patch) | |
| tree | 23c0962d1c255e8e6ca5cc29a0d1fe68e2d1223d /src/include/nodes | |
| parent | d68a00391214be2020e49be4b55f761d47a5c229 (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/include/nodes')
| -rw-r--r-- | src/include/nodes/execnodes.h | 48 | ||||
| -rw-r--r-- | src/include/nodes/nodes.h | 6 | ||||
| -rw-r--r-- | src/include/nodes/pathnodes.h | 12 | ||||
| -rw-r--r-- | src/include/nodes/plannodes.h | 6 |
4 files changed, 36 insertions, 36 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 0ec5509e7e9..105180764e1 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -2046,11 +2046,11 @@ typedef struct MaterialState Tuplestorestate *tuplestorestate; } MaterialState; -struct ResultCacheEntry; -struct ResultCacheTuple; -struct ResultCacheKey; +struct MemoizeEntry; +struct MemoizeTuple; +struct MemoizeKey; -typedef struct ResultCacheInstrumentation +typedef struct MemoizeInstrumentation { uint64 cache_hits; /* number of rescans where we've found the * scan parameter values to be cached */ @@ -2063,31 +2063,31 @@ typedef struct ResultCacheInstrumentation * able to free enough space to store the * current scan's tuples. */ uint64 mem_peak; /* peak memory usage in bytes */ -} ResultCacheInstrumentation; +} MemoizeInstrumentation; /* ---------------- - * Shared memory container for per-worker resultcache information + * Shared memory container for per-worker memoize information * ---------------- */ -typedef struct SharedResultCacheInfo +typedef struct SharedMemoizeInfo { int num_workers; - ResultCacheInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER]; -} SharedResultCacheInfo; + MemoizeInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER]; +} SharedMemoizeInfo; /* ---------------- - * ResultCacheState information + * MemoizeState information * - * resultcache nodes are used to cache recent and commonly seen results - * from a parameterized scan. + * memoize nodes are used to cache recent and commonly seen results from + * a parameterized scan. * ---------------- */ -typedef struct ResultCacheState +typedef struct MemoizeState { ScanState ss; /* its first field is NodeTag */ - int rc_status; /* value of ExecResultCache state machine */ + int mstatus; /* value of ExecMemoize state machine */ int nkeys; /* number of cache keys */ - struct resultcache_hash *hashtable; /* hash table for cache entries */ + struct memoize_hash *hashtable; /* hash table for cache entries */ TupleDesc hashkeydesc; /* tuple descriptor for cache keys */ TupleTableSlot *tableslot; /* min tuple slot for existing cache entries */ TupleTableSlot *probeslot; /* virtual slot used for hash lookups */ @@ -2100,17 +2100,17 @@ typedef struct ResultCacheState uint64 mem_limit; /* memory limit in bytes for the cache */ MemoryContext tableContext; /* memory context to store cache data */ dlist_head lru_list; /* least recently used entry list */ - struct ResultCacheTuple *last_tuple; /* Used to point to the last tuple - * returned during a cache hit and - * the tuple we last stored when - * populating the cache. */ - struct ResultCacheEntry *entry; /* the entry that 'last_tuple' belongs to - * or NULL if 'last_tuple' is NULL. */ + struct MemoizeTuple *last_tuple; /* Used to point to the last tuple + * returned during a cache hit and the + * tuple we last stored when + * populating the cache. */ + struct MemoizeEntry *entry; /* the entry that 'last_tuple' belongs to or + * NULL if 'last_tuple' is NULL. */ bool singlerow; /* true if the cache entry is to be marked as * complete after caching the first tuple. */ - ResultCacheInstrumentation stats; /* execution statistics */ - SharedResultCacheInfo *shared_info; /* statistics for parallel workers */ -} ResultCacheState; + MemoizeInstrumentation stats; /* execution statistics */ + SharedMemoizeInfo *shared_info; /* statistics for parallel workers */ +} MemoizeState; /* ---------------- * When performing sorting by multiple keys, it's possible that the input diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index d9e417bcd70..f7b009ec43b 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -74,7 +74,7 @@ typedef enum NodeTag T_MergeJoin, T_HashJoin, T_Material, - T_ResultCache, + T_Memoize, T_Sort, T_IncrementalSort, T_Group, @@ -133,7 +133,7 @@ typedef enum NodeTag T_MergeJoinState, T_HashJoinState, T_MaterialState, - T_ResultCacheState, + T_MemoizeState, T_SortState, T_IncrementalSortState, T_GroupState, @@ -244,7 +244,7 @@ typedef enum NodeTag T_MergeAppendPath, T_GroupResultPath, T_MaterialPath, - T_ResultCachePath, + T_MemoizePath, T_UniquePath, T_GatherPath, T_GatherMergePath, diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h index bebf774818f..a692bcfb53a 100644 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@ -1495,11 +1495,11 @@ typedef struct MaterialPath } MaterialPath; /* - * ResultCachePath represents a ResultCache plan node, i.e., a cache that - * caches tuples from parameterized paths to save the underlying node from - * having to be rescanned for parameter values which are already cached. + * MemoizePath represents a Memoize plan node, i.e., a cache that caches + * tuples from parameterized paths to save the underlying node from having to + * be rescanned for parameter values which are already cached. */ -typedef struct ResultCachePath +typedef struct MemoizePath { Path path; Path *subpath; /* outerpath to cache tuples from */ @@ -1511,7 +1511,7 @@ typedef struct ResultCachePath uint32 est_entries; /* The maximum number of entries that the * planner expects will fit in the cache, or 0 * if unknown */ -} ResultCachePath; +} MemoizePath; /* * UniquePath represents elimination of distinct rows from the output of @@ -2111,7 +2111,7 @@ typedef struct RestrictInfo Selectivity left_mcvfreq; /* left side's most common val's freq */ Selectivity right_mcvfreq; /* right side's most common val's freq */ - /* hash equality operator used for result cache, else InvalidOid */ + /* hash equality operator used for memoize nodes, else InvalidOid */ Oid hasheqoperator; } RestrictInfo; diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index aaa3b65d049..98a4c73f939 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -781,10 +781,10 @@ typedef struct Material } Material; /* ---------------- - * result cache node + * memoize node * ---------------- */ -typedef struct ResultCache +typedef struct Memoize { Plan plan; @@ -799,7 +799,7 @@ typedef struct ResultCache uint32 est_entries; /* The maximum number of entries that the * planner expects will fit in the cache, or 0 * if unknown */ -} ResultCache; +} Memoize; /* ---------------- * sort node |
