summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/allpaths.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r--src/backend/optimizer/path/allpaths.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index b94b8a58112..4e0d9ca4e57 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.179 2009/01/01 17:23:43 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/allpaths.c,v 1.180 2009/02/15 20:16:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -225,19 +225,25 @@ set_plain_rel_pathlist(PlannerInfo *root, RelOptInfo *rel, RangeTblEntry *rte)
return;
}
+ /*
+ * Test any partial indexes of rel for applicability. We must do this
+ * first since partial unique indexes can affect size estimates.
+ */
+ check_partial_indexes(root, rel);
+
/* Mark rel with estimated output rows, width, etc */
set_baserel_size_estimates(root, rel);
- /* Test any partial indexes of rel for applicability */
- check_partial_indexes(root, rel);
-
/*
* Check to see if we can extract any restriction conditions from join
* quals that are OR-of-AND structures. If so, add them to the rel's
- * restriction list, and recompute the size estimates.
+ * restriction list, and redo the above steps.
*/
if (create_or_index_quals(root, rel))
+ {
+ check_partial_indexes(root, rel);
set_baserel_size_estimates(root, rel);
+ }
/*
* Generate paths and add them to the rel's pathlist.