diff options
author | David Rowley <drowley@postgresql.org> | 2021-07-14 12:45:00 +1200 |
---|---|---|
committer | David Rowley <drowley@postgresql.org> | 2021-07-14 12:45:00 +1200 |
commit | 47ca4836441d1c24f75a94d43af8bd72d4c8d057 (patch) | |
tree | c04f184de05c3439eb2579fd6e4f27bebbd6402e /src/include/nodes/execnodes.h | |
parent | 6201fa3c166fe2383dd44a9dd5082bc748c2937a (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/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 48 |
1 files changed, 24 insertions, 24 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 |