Commit 1aa1827d authored by Vadim B. Mikheev's avatar Vadim B. Mikheev

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').
parent 8e909781
......@@ -8,7 +8,7 @@
*
*
* 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) \
((index->indproc == InvalidOid) ? \
equal_indexkey_var(indkeys,opnd) : \
match_indexkey_operand(indkeys, opnd, rel) : \
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--
* 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.
*/
#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))
#endif
{
restrict_op =
get_commutator(((Oper*)((Expr*)clause)->oper)->opno);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment