diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2001-07-16 05:07:00 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2001-07-16 05:07:00 +0000 |
commit | f31dc0ada731d89313dbca7ef5da91d674fc640c (patch) | |
tree | a9c8343c489be6f99c5a9dff58838f72cf7d5dc4 /src/backend/optimizer/util/pathnode.c | |
parent | 237e5dfa581503b2ab877c73eecde517d284563c (diff) | |
download | postgresql-f31dc0ada731d89313dbca7ef5da91d674fc640c.tar.gz postgresql-f31dc0ada731d89313dbca7ef5da91d674fc640c.zip |
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.
Diffstat (limited to 'src/backend/optimizer/util/pathnode.c')
-rw-r--r-- | src/backend/optimizer/util/pathnode.c | 9 |
1 files changed, 8 insertions, 1 deletions
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; |