aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2021-04-01 13:33:23 +1300
committerDavid Rowley <drowley@postgresql.org>2021-04-01 13:33:23 +1300
commit28b3e3905c982c42fb10ee800e6f881e9742c89d (patch)
tree5368a84ddedf0c0da61fc9ec73ea148658821f0b /src/include
parentb6002a796dc0bfe721db5eaa54ba9d24fd9fd416 (diff)
downloadpostgresql-28b3e3905c982c42fb10ee800e6f881e9742c89d.tar.gz
postgresql-28b3e3905c982c42fb10ee800e6f881e9742c89d.zip
Revert b6002a796
This removes "Add Result Cache executor node". It seems that something weird is going on with the tracking of cache hits and misses as highlighted by many buildfarm animals. It's not yet clear what the problem is as other parts of the plan indicate that the cache did work correctly, it's just the hits and misses that were being reported as 0. This is especially a bad time to have the buildfarm so broken, so reverting before too many more animals go red. Discussion: https://postgr.es/m/CAApHDvq_hydhfovm4=izgWs+C5HqEeRScjMbOgbpC-jRAeK3Yw@mail.gmail.com
Diffstat (limited to 'src/include')
-rw-r--r--src/include/executor/executor.h7
-rw-r--r--src/include/executor/nodeResultCache.h31
-rw-r--r--src/include/lib/ilist.h19
-rw-r--r--src/include/nodes/execnodes.h66
-rw-r--r--src/include/nodes/nodes.h3
-rw-r--r--src/include/nodes/pathnodes.h22
-rw-r--r--src/include/nodes/plannodes.h21
-rw-r--r--src/include/optimizer/cost.h1
-rw-r--r--src/include/optimizer/pathnode.h7
9 files changed, 0 insertions, 177 deletions
diff --git a/src/include/executor/executor.h b/src/include/executor/executor.h
index 26dcc4485eb..34dd861eff0 100644
--- a/src/include/executor/executor.h
+++ b/src/include/executor/executor.h
@@ -275,13 +275,6 @@ extern ExprState *ExecBuildGroupingEqual(TupleDesc ldesc, TupleDesc rdesc,
const Oid *eqfunctions,
const Oid *collations,
PlanState *parent);
-extern ExprState *ExecBuildParamSetEqual(TupleDesc desc,
- const TupleTableSlotOps *lops,
- const TupleTableSlotOps *rops,
- const Oid *eqfunctions,
- const Oid *collations,
- const List *param_exprs,
- PlanState *parent);
extern ProjectionInfo *ExecBuildProjectionInfo(List *targetList,
ExprContext *econtext,
TupleTableSlot *slot,
diff --git a/src/include/executor/nodeResultCache.h b/src/include/executor/nodeResultCache.h
deleted file mode 100644
index df671d16f96..00000000000
--- a/src/include/executor/nodeResultCache.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * nodeResultCache.h
- *
- *
- *
- * Portions Copyright (c) 2021, PostgreSQL Global Development Group
- * Portions Copyright (c) 1994, Regents of the University of California
- *
- * src/include/executor/nodeResultCache.h
- *
- *-------------------------------------------------------------------------
- */
-#ifndef NODERESULTCACHE_H
-#define NODERESULTCACHE_H
-
-#include "nodes/execnodes.h"
-
-extern ResultCacheState *ExecInitResultCache(ResultCache *node, EState *estate, int eflags);
-extern void ExecEndResultCache(ResultCacheState *node);
-extern void ExecReScanResultCache(ResultCacheState *node);
-extern double ExecEstimateCacheEntryOverheadBytes(double ntuples);
-extern void ExecResultCacheEstimate(ResultCacheState *node,
- ParallelContext *pcxt);
-extern void ExecResultCacheInitializeDSM(ResultCacheState *node,
- ParallelContext *pcxt);
-extern void ExecResultCacheInitializeWorker(ResultCacheState *node,
- ParallelWorkerContext *pwcxt);
-extern void ExecResultCacheRetrieveInstrumentation(ResultCacheState *node);
-
-#endif /* NODERESULTCACHE_H */
diff --git a/src/include/lib/ilist.h b/src/include/lib/ilist.h
index ddbdb207afa..aa196428ed9 100644
--- a/src/include/lib/ilist.h
+++ b/src/include/lib/ilist.h
@@ -395,25 +395,6 @@ dlist_move_head(dlist_head *head, dlist_node *node)
}
/*
- * Move element from its current position in the list to the tail position in
- * the same list.
- *
- * Undefined behaviour if 'node' is not already part of the list.
- */
-static inline void
-dlist_move_tail(dlist_head *head, dlist_node *node)
-{
- /* fast path if it's already at the tail */
- if (head->head.prev == node)
- return;
-
- dlist_delete(node);
- dlist_push_tail(head, node);
-
- dlist_check(head);
-}
-
-/*
* Check whether 'node' has a following node.
* Caution: unreliable if 'node' is not in the list.
*/
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h
index 52d1fa018b5..3b39369a492 100644
--- a/src/include/nodes/execnodes.h
+++ b/src/include/nodes/execnodes.h
@@ -17,7 +17,6 @@
#include "access/tupconvert.h"
#include "executor/instrument.h"
#include "fmgr.h"
-#include "lib/ilist.h"
#include "lib/pairingheap.h"
#include "nodes/params.h"
#include "nodes/plannodes.h"
@@ -2038,71 +2037,6 @@ typedef struct MaterialState
Tuplestorestate *tuplestorestate;
} MaterialState;
-struct ResultCacheEntry;
-struct ResultCacheTuple;
-struct ResultCacheKey;
-
-typedef struct ResultCacheInstrumentation
-{
- uint64 cache_hits; /* number of rescans where we've found the
- * scan parameter values to be cached */
- uint64 cache_misses; /* number of rescans where we've not found the
- * scan parameter values to be cached. */
- uint64 cache_evictions; /* number of cache entries removed due to
- * the need to free memory */
- uint64 cache_overflows; /* number of times we've had to bypass the
- * cache when filling it due to not being
- * able to free enough space to store the
- * current scan's tuples. */
- uint64 mem_peak; /* peak memory usage in bytes */
-} ResultCacheInstrumentation;
-
-/* ----------------
- * Shared memory container for per-worker resultcache information
- * ----------------
- */
-typedef struct SharedResultCacheInfo
-{
- int num_workers;
- ResultCacheInstrumentation sinstrument[FLEXIBLE_ARRAY_MEMBER];
-} SharedResultCacheInfo;
-
-/* ----------------
- * ResultCacheState information
- *
- * resultcache nodes are used to cache recent and commonly seen results
- * from a parameterized scan.
- * ----------------
- */
-typedef struct ResultCacheState
-{
- ScanState ss; /* its first field is NodeTag */
- int rc_status; /* value of ExecResultCache state machine */
- int nkeys; /* number of cache keys */
- struct resultcache_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 */
- ExprState *cache_eq_expr; /* Compare exec params to hash key */
- ExprState **param_exprs; /* exprs containing the parameters to this
- * node */
- FmgrInfo *hashfunctions; /* lookup data for hash funcs nkeys in size */
- Oid *collations; /* collation for comparisons nkeys in size */
- uint64 mem_used; /* bytes of memory used by cache */
- 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. */
- 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;
/* ----------------
* 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 2051abbbf92..704f00fd300 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -74,7 +74,6 @@ typedef enum NodeTag
T_MergeJoin,
T_HashJoin,
T_Material,
- T_ResultCache,
T_Sort,
T_IncrementalSort,
T_Group,
@@ -133,7 +132,6 @@ typedef enum NodeTag
T_MergeJoinState,
T_HashJoinState,
T_MaterialState,
- T_ResultCacheState,
T_SortState,
T_IncrementalSortState,
T_GroupState,
@@ -244,7 +242,6 @@ typedef enum NodeTag
T_MergeAppendPath,
T_GroupResultPath,
T_MaterialPath,
- T_ResultCachePath,
T_UniquePath,
T_GatherPath,
T_GatherMergePath,
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h
index a65bda7e3c6..e4e1c15986f 100644
--- a/src/include/nodes/pathnodes.h
+++ b/src/include/nodes/pathnodes.h
@@ -1495,25 +1495,6 @@ 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.
- */
-typedef struct ResultCachePath
-{
- Path path;
- Path *subpath; /* outerpath to cache tuples from */
- List *hash_operators; /* hash operators for each key */
- List *param_exprs; /* cache keys */
- bool singlerow; /* true if the cache entry is to be marked as
- * complete after caching the first record. */
- double calls; /* expected number of rescans */
- uint32 est_entries; /* The maximum number of entries that the
- * planner expects will fit in the cache, or 0
- * if unknown */
-} ResultCachePath;
-
-/*
* UniquePath represents elimination of distinct rows from the output of
* its subpath.
*
@@ -2110,9 +2091,6 @@ typedef struct RestrictInfo
Selectivity right_bucketsize; /* avg bucketsize of right side */
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 */
- Oid hasheqoperator;
} RestrictInfo;
/*
diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h
index 1678bd66fed..623dc450ee4 100644
--- a/src/include/nodes/plannodes.h
+++ b/src/include/nodes/plannodes.h
@@ -780,27 +780,6 @@ typedef struct Material
} Material;
/* ----------------
- * result cache node
- * ----------------
- */
-typedef struct ResultCache
-{
- Plan plan;
-
- int numKeys; /* size of the two arrays below */
-
- Oid *hashOperators; /* hash operators for each key */
- Oid *collations; /* cache keys */
- List *param_exprs; /* exprs containing parameters */
- bool singlerow; /* true if the cache entry should be marked as
- * complete after we store the first tuple in
- * it. */
- uint32 est_entries; /* The maximum number of entries that the
- * planner expects will fit in the cache, or 0
- * if unknown */
-} ResultCache;
-
-/* ----------------
* sort node
* ----------------
*/
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 0fe60d82e43..a3fd93fe07f 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -57,7 +57,6 @@ extern PGDLLIMPORT bool enable_incremental_sort;
extern PGDLLIMPORT bool enable_hashagg;
extern PGDLLIMPORT bool enable_nestloop;
extern PGDLLIMPORT bool enable_material;
-extern PGDLLIMPORT bool enable_resultcache;
extern PGDLLIMPORT bool enable_mergejoin;
extern PGDLLIMPORT bool enable_hashjoin;
extern PGDLLIMPORT bool enable_gathermerge;
diff --git a/src/include/optimizer/pathnode.h b/src/include/optimizer/pathnode.h
index 53261ee91fd..d539bc27830 100644
--- a/src/include/optimizer/pathnode.h
+++ b/src/include/optimizer/pathnode.h
@@ -82,13 +82,6 @@ extern GroupResultPath *create_group_result_path(PlannerInfo *root,
PathTarget *target,
List *havingqual);
extern MaterialPath *create_material_path(RelOptInfo *rel, Path *subpath);
-extern ResultCachePath *create_resultcache_path(PlannerInfo *root,
- RelOptInfo *rel,
- Path *subpath,
- List *param_exprs,
- List *hash_operators,
- bool singlerow,
- double calls);
extern UniquePath *create_unique_path(PlannerInfo *root, RelOptInfo *rel,
Path *subpath, SpecialJoinInfo *sjinfo);
extern GatherPath *create_gather_path(PlannerInfo *root,