mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
Fix oversight in indexscan plan creation. I recently added code to use
predicate_implied_by() to detect redundant filter conditions, but forgot that predicate_implied_by() assumes its first argument contains only immutable functions. Add a check to guarantee that. Also, test to see if filter conditions can be discarded because they are redundant with the predicate of a partial index.
This commit is contained in:
@ -9,7 +9,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.2 2005/07/23 21:05:47 tgl Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/optimizer/util/predtest.c,v 1.3 2005/10/06 16:01:55 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -47,7 +47,7 @@ static bool btree_predicate_proof(Expr *predicate, Node *clause,
|
||||
* valid, but no worse consequences will ensue.
|
||||
*
|
||||
* We assume the predicate has already been checked to contain only
|
||||
* immutable functions and operators. (In current use this is true
|
||||
* immutable functions and operators. (In most current uses this is true
|
||||
* because the predicate is part of an index predicate that has passed
|
||||
* CheckPredicate().) We dare not make deductions based on non-immutable
|
||||
* functions, because they might change answers between the time we make
|
||||
|
Reference in New Issue
Block a user