diff options
author | Bruce Momjian <bruce@momjian.us> | 1998-08-02 07:10:38 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 1998-08-02 07:10:38 +0000 |
commit | 39844ac2c332af0b8df86e44ad7e56deafbbfd56 (patch) | |
tree | d9891ddd3ae9d71543e824794ddfd8b0bf4334b3 /src | |
parent | 34aecb355714c18516b14988689a6c9ee9e539fe (diff) | |
download | postgresql-39844ac2c332af0b8df86e44ad7e56deafbbfd56.tar.gz postgresql-39844ac2c332af0b8df86e44ad7e56deafbbfd56.zip |
Fix for OR handling with multiple indexes.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index 851ca064deb..d8453a9455d 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.21 1998/08/01 22:44:53 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/indxpath.c,v 1.22 1998/08/02 07:10:38 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -307,13 +307,18 @@ match_index_orclause(RelOptInfo *rel, List *other_matching_indices) { Node *clause = NULL; - List *matched_indices = other_matching_indices; + List *matched_indices; List *index_list = NIL; List *clist; foreach(clist, or_clauses) { clause = lfirst(clist); + if (other_matching_indices) + matched_indices = lfirst(other_matching_indices); + else + matched_indices = NIL; + if (is_opclause(clause) && op_class(((Oper *) ((Expr *) clause)->oper)->opno, xclass, index->relam) && @@ -330,11 +335,12 @@ match_index_orclause(RelOptInfo *rel, { matched_indices = lcons(index, matched_indices); } - index_list = lappend(index_list, matched_indices); /* for the first index, we are creating the indexids list */ - if (matched_indices) - matched_indices = lnext(matched_indices); + index_list = lappend(index_list, matched_indices); + + if (other_matching_indices) + other_matching_indices = lnext(other_matching_indices); } return (index_list); |