aboutsummaryrefslogtreecommitdiff
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.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c
index 23998a54bff..5264d508342 100644
--- a/src/backend/optimizer/path/clausesel.c
+++ b/src/backend/optimizer/path/clausesel.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.25 1999/07/25 23:07:24 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.26 1999/09/09 02:35:47 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -230,24 +230,24 @@ compute_clause_selec(Query *root, Node *clause)
int flag;
get_relattval(clause, 0, &relidx, &attno, &constval, &flag);
- if (relidx <= 0 || attno <= 0)
+ if (relidx && attno)
+ s1 = (Cost) restriction_selectivity(oprrest,
+ opno,
+ getrelid(relidx,
+ root->rtable),
+ attno,
+ constval,
+ flag);
+ else
{
/*
- * attno can be Invalid if the clause had a function in it,
+ * attno can be 0 if the clause had a function in it,
* i.e. WHERE myFunc(f) = 10
*
* XXX should be FIXED to use function selectivity
*/
s1 = (Cost) (0.5);
}
- else
- s1 = (Cost) restriction_selectivity(oprrest,
- opno,
- getrelid(relidx,
- root->rtable),
- attno,
- constval,
- flag);
}
}
else
@@ -274,7 +274,8 @@ compute_clause_selec(Query *root, Node *clause)
attno2;
get_rels_atts(clause, &relid1, &attno1, &relid2, &attno2);
- if (relid1 > 0 && relid2 > 0 && attno1 > 0 && attno2 > 0)
+ if (relid1 && relid2 && attno1 && attno2)
+
s1 = (Cost) join_selectivity(oprjoin,
opno,
getrelid(relid1,