1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-30 21:42:05 +03:00

Tweak planner so that index expressions and predicates are matched to

queries without regard to whether coercions are stated explicitly or
implicitly.  Per suggestion from Stephan Szabo.
This commit is contained in:
Tom Lane
2004-03-14 23:41:27 +00:00
parent e1d08faf04
commit 04226b6404
5 changed files with 58 additions and 10 deletions

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.198 2004/02/25 19:41:23 momjian Exp $
* $PostgreSQL: pgsql/src/backend/utils/cache/relcache.c,v 1.199 2004/03/14 23:41:27 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2687,6 +2687,12 @@ RelationGetIndexExpressions(Relation relation)
result = (List *) eval_const_expressions((Node *) result);
/*
* Also mark any coercion format fields as "don't care", so that the
* planner can match to both explicit and implicit coercions.
*/
set_coercionform_dontcare((Node *) result);
/* May as well fix opfuncids too */
fix_opfuncids((Node *) result);
@ -2755,6 +2761,12 @@ RelationGetIndexPredicate(Relation relation)
result = (List *) eval_const_expressions((Node *) result);
/*
* Also mark any coercion format fields as "don't care", so that the
* planner can match to both explicit and implicit coercions.
*/
set_coercionform_dontcare((Node *) result);
/* Also convert to implicit-AND format */
result = make_ands_implicit((Expr *) result);