mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user