From f31dc0ada731d89313dbca7ef5da91d674fc640c Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 16 Jul 2001 05:07:00 +0000 Subject: Partial indexes work again, courtesy of Martijn van Oosterhout. Note: I didn't force an initdb, figuring that one today was enough. However, there is a new function in pg_proc.h, and pg_dump won't be able to dump partial indexes until you add that function. --- src/backend/optimizer/util/pathnode.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/backend/optimizer/util/pathnode.c') diff --git a/src/backend/optimizer/util/pathnode.c b/src/backend/optimizer/util/pathnode.c index 7f1f3b402a4..1377fc06a49 100644 --- a/src/backend/optimizer/util/pathnode.c +++ b/src/backend/optimizer/util/pathnode.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.74 2001/06/05 05:26:04 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/util/pathnode.c,v 1.75 2001/07/16 05:06:58 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -362,6 +362,13 @@ create_index_path(Query *root, pathnode->alljoinquals = false; pathnode->rows = rel->rows; + /* + * Not sure if this is necessary, but it should help if the + * statistics are too far off + */ + if (index->indpred && index->tuples < pathnode->rows) + pathnode->rows = index->tuples; + cost_index(&pathnode->path, root, rel, index, indexquals, false); return pathnode; -- cgit v1.2.3