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/nodes/outfuncs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/backend/nodes/outfuncs.c') diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c index 15a9aa2f939..09dc9ccb5ec 100644 --- a/src/backend/nodes/outfuncs.c +++ b/src/backend/nodes/outfuncs.c @@ -1611,10 +1611,12 @@ _outIndexOptInfo(StringInfo str, IndexOptInfo *node) WRITE_UINT_FIELD(pages); WRITE_FLOAT_FIELD(tuples, "%.0f"); WRITE_INT_FIELD(ncolumns); + WRITE_OID_FIELD(relam); WRITE_NODE_FIELD(indexprs); WRITE_NODE_FIELD(indpred); WRITE_BOOL_FIELD(predOK); WRITE_BOOL_FIELD(unique); + WRITE_BOOL_FIELD(hypothetical); } static void -- cgit v1.2.3