From 7422e0081d04ee4373a822392c729eb892a9d25e Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 16 Feb 2011 19:24:50 -0500 Subject: Fix bogus test for hypothetical indexes in get_actual_variable_range(). That function was supposing that indexoid == 0 for a hypothetical index, but that is not likely to be true in any non-toy implementation of an index adviser, since assigning a fake OID is the only way to know at EXPLAIN time which hypothetical index got selected. Fix by adding a flag to IndexOptInfo to mark hypothetical indexes. Back-patch to 9.0 where get_actual_variable_range() was added. Gurjeet Singh --- src/backend/optimizer/util/plancat.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/backend/optimizer/util/plancat.c') diff --git a/src/backend/optimizer/util/plancat.c b/src/backend/optimizer/util/plancat.c index 10800b488f6..d5d452475bf 100644 --- a/src/backend/optimizer/util/plancat.c +++ b/src/backend/optimizer/util/plancat.c @@ -275,6 +275,7 @@ get_relation_info(PlannerInfo *root, Oid relationObjectId, bool inhparent, ChangeVarNodes((Node *) info->indpred, 1, varno, 0); info->predOK = false; /* set later in indxpath.c */ info->unique = index->indisunique; + info->hypothetical = false; /* * Estimate the index size. If it's not a partial index, we lock -- cgit v1.2.3