1. INDEXSCAN_PATCH changes: (op Param Var) should work too
2. IndexScanableOperand now uses match_indexkey_operand instead of equal_indexkey_var (if we have some index on attribute X then we shouldn't use it for 'where some_func(X) OP CONST').
This commit is contained in:
parent
8e90978146
commit
1aa1827d64
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.4 1996/11/08 05:56:55 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.5 1997/01/22 06:25:42 vadim Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -441,9 +441,17 @@ group_clauses_by_indexkey(Rel *rel,
|
|||||||
*/
|
*/
|
||||||
#define IndexScanableOperand(opnd, indkeys, rel, index) \
|
#define IndexScanableOperand(opnd, indkeys, rel, index) \
|
||||||
((index->indproc == InvalidOid) ? \
|
((index->indproc == InvalidOid) ? \
|
||||||
equal_indexkey_var(indkeys,opnd) : \
|
match_indexkey_operand(indkeys, opnd, rel) : \
|
||||||
function_index_operand((Expr*)opnd,rel,index))
|
function_index_operand((Expr*)opnd,rel,index))
|
||||||
|
|
||||||
|
/*
|
||||||
|
* There was
|
||||||
|
* equal_indexkey_var(indkeys,opnd) : \
|
||||||
|
* above, and now
|
||||||
|
* match_indexkey_operand(indkeys, opnd, rel) : \
|
||||||
|
* - vadim 01/22/97
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* match_clause_to-indexkey--
|
* match_clause_to-indexkey--
|
||||||
* Finds the first of a relation's available restriction clauses that
|
* Finds the first of a relation's available restriction clauses that
|
||||||
@ -513,7 +521,13 @@ match_clause_to_indexkey(Rel *rel,
|
|||||||
/*
|
/*
|
||||||
* Must try to commute the clause to standard s-arg format.
|
* Must try to commute the clause to standard s-arg format.
|
||||||
*/
|
*/
|
||||||
|
#ifdef INDEXSCAN_PATCH
|
||||||
|
/* ...And here... - vadim 01/22/97 */
|
||||||
|
else if ((leftop && IsA(leftop,Const)) ||
|
||||||
|
(leftop && IsA(leftop,Param)))
|
||||||
|
#else
|
||||||
else if (leftop && IsA(leftop,Const))
|
else if (leftop && IsA(leftop,Const))
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
restrict_op =
|
restrict_op =
|
||||||
get_commutator(((Oper*)((Expr*)clause)->oper)->opno);
|
get_commutator(((Oper*)((Expr*)clause)->oper)->opno);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user