diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-03-23 00:58:36 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-03-23 00:58:36 +0000 |
commit | 1afaa2557adb86cef224982093201ad035588eeb (patch) | |
tree | 8111a81e5c4cb85466336ee867d1e8337df3d3dc /src | |
parent | cad764f349a535459e60926ed11e31c867d2ccd3 (diff) | |
download | postgresql-1afaa2557adb86cef224982093201ad035588eeb.tar.gz postgresql-1afaa2557adb86cef224982093201ad035588eeb.zip |
If we cannot get a real estimate for the selectivity of a range query,
use a default value that's fairly small. We were generating a result
of about 0.1, but I think 0.01 is probably better --- want to encourage
use of an indexscan in this situation.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/optimizer/path/clausesel.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/backend/optimizer/path/clausesel.c b/src/backend/optimizer/path/clausesel.c index 09d6d277c9a..baa99a7d28b 100644 --- a/src/backend/optimizer/path/clausesel.c +++ b/src/backend/optimizer/path/clausesel.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.31 2000/03/17 02:36:14 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.32 2000/03/23 00:58:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -194,9 +194,11 @@ clauselist_selectivity(Query *root, else { /* One or both is probably a default estimate, - * so punt and just merge them in generically. + * so supply a default estimate for the selectivity + * of the range query. We rather optimistically assume + * that the range is tight... */ - s1 *= rqlist->hibound * rqlist->lobound; + s1 *= 0.01; } } else |