diff options
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index d1143381d2d..a6660fc4d32 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.216 2005/03/07 04:42:16 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.217 2005/03/28 00:58:26 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -2788,14 +2788,11 @@ RelationGetIndexExpressions(Relation relation) pfree(exprsString); /* - * Run the expressions through flatten_andors and - * eval_const_expressions. This is not just an optimization, but is - * necessary, because the planner will be comparing them to - * similarly-processed qual clauses, and may fail to detect valid - * matches without this. + * Run the expressions through eval_const_expressions. This is not just an + * optimization, but is necessary, because the planner will be comparing + * them to similarly-processed qual clauses, and may fail to detect valid + * matches without this. We don't bother with canonicalize_qual, however. */ - result = (List *) flatten_andors((Node *) result); - result = (List *) eval_const_expressions((Node *) result); /* @@ -2863,16 +2860,18 @@ RelationGetIndexPredicate(Relation relation) pfree(predString); /* - * Run the expression through canonicalize_qual and - * eval_const_expressions. This is not just an optimization, but is - * necessary, because the planner will be comparing it to - * similarly-processed qual clauses, and may fail to detect valid - * matches without this. + * Run the expression through const-simplification and canonicalization. + * This is not just an optimization, but is necessary, because the planner + * will be comparing it to similarly-processed qual clauses, and may fail + * to detect valid matches without this. This must match the processing + * done to qual clauses in preprocess_expression()! (We can skip the + * stuff involving subqueries, however, since we don't allow any in + * index predicates.) */ - result = (List *) canonicalize_qual((Expr *) result); - result = (List *) eval_const_expressions((Node *) result); + result = (List *) canonicalize_qual((Expr *) result); + /* * Also mark any coercion format fields as "don't care", so that the * planner can match to both explicit and implicit coercions. |