aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan/createplan.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-12-29 20:11:45 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-12-29 20:11:45 +0000
commit649b5ec7c8a3050a30bd6d36003ba3a681c9a198 (patch)
treeaf041b646426d71d9ea1113837b5f7a9001082c9 /src/backend/optimizer/plan/createplan.c
parent84d723b6cefcf25b8c800f8aa6cf3c9538a546b4 (diff)
downloadpostgresql-649b5ec7c8a3050a30bd6d36003ba3a681c9a198.tar.gz
postgresql-649b5ec7c8a3050a30bd6d36003ba3a681c9a198.zip
Add the ability to store inheritance-tree statistics in pg_statistic,
and teach ANALYZE to compute such stats for tables that have subclasses. Per my proposal of yesterday. autovacuum still needs to be taught about running ANALYZE on parent tables when their subclasses change, but the feature is useful even without that.
Diffstat (limited to 'src/backend/optimizer/plan/createplan.c')
-rw-r--r--src/backend/optimizer/plan/createplan.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/optimizer/plan/createplan.c b/src/backend/optimizer/plan/createplan.c
index 41238b7c0e6..43b0c123ca2 100644
--- a/src/backend/optimizer/plan/createplan.c
+++ b/src/backend/optimizer/plan/createplan.c
@@ -10,7 +10,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.267 2009/11/15 02:45:35 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/plan/createplan.c,v 1.268 2009/12/29 20:11:45 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -115,6 +115,7 @@ static HashJoin *make_hashjoin(List *tlist,
static Hash *make_hash(Plan *lefttree,
Oid skewTable,
AttrNumber skewColumn,
+ bool skewInherit,
Oid skewColType,
int32 skewColTypmod);
static MergeJoin *make_mergejoin(List *tlist,
@@ -1898,6 +1899,7 @@ create_hashjoin_plan(PlannerInfo *root,
List *hashclauses;
Oid skewTable = InvalidOid;
AttrNumber skewColumn = InvalidAttrNumber;
+ bool skewInherit = false;
Oid skewColType = InvalidOid;
int32 skewColTypmod = -1;
HashJoin *join_plan;
@@ -1969,6 +1971,7 @@ create_hashjoin_plan(PlannerInfo *root,
{
skewTable = rte->relid;
skewColumn = var->varattno;
+ skewInherit = rte->inh;
skewColType = var->vartype;
skewColTypmod = var->vartypmod;
}
@@ -1981,6 +1984,7 @@ create_hashjoin_plan(PlannerInfo *root,
hash_plan = make_hash(inner_plan,
skewTable,
skewColumn,
+ skewInherit,
skewColType,
skewColTypmod);
join_plan = make_hashjoin(tlist,
@@ -2794,6 +2798,7 @@ static Hash *
make_hash(Plan *lefttree,
Oid skewTable,
AttrNumber skewColumn,
+ bool skewInherit,
Oid skewColType,
int32 skewColTypmod)
{
@@ -2814,6 +2819,7 @@ make_hash(Plan *lefttree,
node->skewTable = skewTable;
node->skewColumn = skewColumn;
+ node->skewInherit = skewInherit;
node->skewColType = skewColType;
node->skewColTypmod = skewColTypmod;