mirror of
https://github.com/postgres/postgres.git
synced 2025-11-07 19:06:32 +03:00
Modify partial-index-predicate applicability tester to test whether
clauses are equal(), before trying to match them up using btree opclass inference rules. This allows it to recognize many simple cases involving non-btree operations, for example 'x IS NULL'. Clean up code a little.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.53 2001/07/17 21:53:01 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/indexcmds.c,v 1.54 2001/08/06 18:09:45 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -146,10 +146,12 @@ DefineIndex(char *heapRelationName,
|
||||
/*
|
||||
* Convert the partial-index predicate from parsetree form to
|
||||
* an implicit-AND qual expression, for easier evaluation at runtime.
|
||||
* While we are at it, we reduce it to a canonical (CNF or DNF) form
|
||||
* to simplify the task of proving implications.
|
||||
*/
|
||||
if (predicate != NULL && rangetable != NIL)
|
||||
{
|
||||
cnfPred = cnfify((Expr *) copyObject(predicate), true);
|
||||
cnfPred = canonicalize_qual((Expr *) copyObject(predicate), true);
|
||||
fix_opids((Node *) cnfPred);
|
||||
CheckPredicate(cnfPred, rangetable, relationId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user