diff options
Diffstat (limited to 'src/backend/optimizer/path/indxpath.c')
-rw-r--r-- | src/backend/optimizer/path/indxpath.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/backend/optimizer/path/indxpath.c b/src/backend/optimizer/path/indxpath.c index f55f7fc9188..0a398849f8e 100644 --- a/src/backend/optimizer/path/indxpath.c +++ b/src/backend/optimizer/path/indxpath.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.178 2005/04/25 01:30:13 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/optimizer/path/indxpath.c,v 1.179 2005/04/25 03:58:29 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -500,8 +500,14 @@ choose_bitmap_and(Query *root, RelOptInfo *rel, List *paths) * And we consider an index redundant if all its index conditions were * already used by earlier indexes. (We could use pred_test() to have * a more intelligent, but much more expensive, check --- but in most - * cases simple equality should suffice, since after all the index - * conditions are all coming from the same query clauses.) + * cases simple pointer equality should suffice, since after all the + * index conditions are all coming from the same RestrictInfo lists.) + * + * XXX is there any risk of throwing away a useful partial index here + * because we don't explicitly look at indpred? At least in simple + * cases, the partial index will sort before competing non-partial + * indexes and so it makes the right choice, but perhaps we need to + * work harder. */ /* Convert list to array so we can apply qsort */ @@ -530,7 +536,7 @@ choose_bitmap_and(Query *root, RelOptInfo *rel, List *paths) if (IsA(newpath, IndexPath)) { newqual = ((IndexPath *) newpath)->indexclauses; - if (list_difference(newqual, qualsofar) == NIL) + if (list_difference_ptr(newqual, qualsofar) == NIL) continue; /* redundant */ } |