aboutsummaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2016-06-07 17:21:17 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2016-06-07 17:21:17 -0400
commit77ba610805e7ef9ba9c9a593ea8b1ca8f98f8bcb (patch)
tree1c607e007c59f23ab471bb790e1237cf8d849e5e /src/include
parent5c6d2a5e7c83bf6e157fe4ca0ab9b123012289e9 (diff)
downloadpostgresql-77ba610805e7ef9ba9c9a593ea8b1ca8f98f8bcb.tar.gz
postgresql-77ba610805e7ef9ba9c9a593ea8b1ca8f98f8bcb.zip
Revert "Use Foreign Key relationships to infer multi-column join selectivity".
This commit reverts 137805f89 as well as the associated commits 015e88942, 5306df283, and 68d704edb. We found multiple bugs in this feature, and there was concern about possible planner slowdown (though to be fair, exhibiting a very large slowdown proved difficult). The way forward requires a considerable rewrite, which may or may not be possible to accomplish in time for beta2. In my judgment reviewing the rewrite will be easier to accomplish starting from a clean slate, so let's temporarily revert what's there now. This also leaves us in a safe state if it turns out to be necessary to postpone the rewrite to the next development cycle. Discussion: <20160429102531.GA13701@huehner.biz>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/nodes/nodes.h1
-rw-r--r--src/include/nodes/relation.h22
-rw-r--r--src/include/optimizer/cost.h1
-rw-r--r--src/include/optimizer/paths.h2
-rw-r--r--src/include/utils/rel.h3
-rw-r--r--src/include/utils/relcache.h1
6 files changed, 0 insertions, 30 deletions
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index ea65f2e453b..5953db45a89 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -223,7 +223,6 @@ typedef enum NodeTag
T_PlannerGlobal,
T_RelOptInfo,
T_IndexOptInfo,
- T_ForeignKeyOptInfo,
T_ParamPathInfo,
T_Path,
T_IndexPath,
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h
index 45739c3ee7a..b1f6cf45f0b 100644
--- a/src/include/nodes/relation.h
+++ b/src/include/nodes/relation.h
@@ -516,7 +516,6 @@ typedef struct RelOptInfo
List *lateral_vars; /* LATERAL Vars and PHVs referenced by rel */
Relids lateral_referencers; /* rels that reference me laterally */
List *indexlist; /* list of IndexOptInfo */
- List *fkeylist; /* list of ForeignKeyOptInfo */
BlockNumber pages; /* size estimates derived from pg_class */
double tuples;
double allvisfrac;
@@ -623,27 +622,6 @@ typedef struct IndexOptInfo
void (*amcostestimate) (); /* AM's cost estimator */
} IndexOptInfo;
-/*
- * ForeignKeyOptInfo
- * Per-foreign-key information for planning/optimization
- *
- * Only includes columns from pg_constraint related to foreign keys.
- *
- * conkeys[], confkeys[] and conpfeqop[] each have nkeys entries.
- */
-typedef struct ForeignKeyOptInfo
-{
- NodeTag type;
-
- Oid conrelid; /* relation constrained by the foreign key */
- Oid confrelid; /* relation referenced by the foreign key */
-
- int nkeys; /* number of columns in the foreign key */
- int *conkeys; /* attnums of columns in the constrained table */
- int *confkeys; /* attnums of columns in the referenced table */
- Oid *conpfeqop; /* OIDs of equality operators used by the FK */
-
-} ForeignKeyOptInfo;
/*
* EquivalenceClasses
diff --git a/src/include/optimizer/cost.h b/src/include/optimizer/cost.h
index 58ac1638ec1..d4adca6836a 100644
--- a/src/include/optimizer/cost.h
+++ b/src/include/optimizer/cost.h
@@ -66,7 +66,6 @@ extern bool enable_nestloop;
extern bool enable_material;
extern bool enable_mergejoin;
extern bool enable_hashjoin;
-extern bool enable_fkey_estimates;
extern int constraint_exclusion;
extern double clamp_row_est(double nrows);
diff --git a/src/include/optimizer/paths.h b/src/include/optimizer/paths.h
index e0ac4515c95..f3b25e2419c 100644
--- a/src/include/optimizer/paths.h
+++ b/src/include/optimizer/paths.h
@@ -76,8 +76,6 @@ extern Expr *adjust_rowcompare_for_index(RowCompareExpr *clause,
int indexcol,
List **indexcolnos,
bool *var_on_left_p);
-extern bool has_matching_fkey(RelOptInfo *rel, RelOptInfo *frel, List *clauses,
- bool reverse);
/*
* tidpath.h
diff --git a/src/include/utils/rel.h b/src/include/utils/rel.h
index a0ba4177645..5d354c0f67b 100644
--- a/src/include/utils/rel.h
+++ b/src/include/utils/rel.h
@@ -95,9 +95,6 @@ typedef struct RelationData
Oid rd_oidindex; /* OID of unique index on OID, if any */
Oid rd_replidindex; /* OID of replica identity index, if any */
- /* data managed by RelationGetFKList: */
- List *rd_fkeylist; /* OIDs of foreign keys */
-
/* data managed by RelationGetIndexAttrBitmap: */
Bitmapset *rd_indexattr; /* identifies columns used in indexes */
Bitmapset *rd_keyattr; /* cols that can be ref'd by foreign keys */
diff --git a/src/include/utils/relcache.h b/src/include/utils/relcache.h
index 7f07c269145..1b4830462d5 100644
--- a/src/include/utils/relcache.h
+++ b/src/include/utils/relcache.h
@@ -38,7 +38,6 @@ extern void RelationClose(Relation relation);
* Routines to compute/retrieve additional cached information
*/
extern List *RelationGetIndexList(Relation relation);
-extern List *RelationGetFKeyList(Relation relation);
extern Oid RelationGetOidIndex(Relation relation);
extern Oid RelationGetReplicaIndex(Relation relation);
extern List *RelationGetIndexExpressions(Relation relation);