summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/clausesel.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/path/clausesel.c')
-rw-r--r--src/backend/optimizer/path/clausesel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c
index 463408f26fd..ccab70796e6 100644
--- a/src/backend/optimizer/path/clausesel.c
+++ b/src/backend/optimizer/path/clausesel.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/optimizer/path/clausesel.c,v 1.82.2.1 2007/08/31 23:35:29 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/optimizer/path/clausesel.c,v 1.82.2.2 2008/12/01 21:06:30 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -445,6 +445,12 @@ clause_selectivity(PlannerInfo *root,
}
/*
+ * If the clause is marked redundant, always return 1.0.
+ */
+ if (rinfo->this_selec > 1)
+ return (Selectivity) 1.0;
+
+ /*
* If possible, cache the result of the selectivity calculation for
* the clause. We can cache if varRelid is zero or the clause
* contains only vars of that relid --- otherwise varRelid will affect