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:
14
src/backend/utils/cache/relcache.c
vendored
14
src/backend/utils/cache/relcache.c
vendored
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user