Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1afaa25

Browse files
committed
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.
1 parent cad764f commit 1afaa25

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/backend/optimizer/path/clausesel.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.31 2000/03/17 02:36:14 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/optimizer/path/clausesel.c,v 1.32 2000/03/23 00:58:36 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -194,9 +194,11 @@ clauselist_selectivity(Query *root,
194194
else
195195
{
196196
/* One or both is probably a default estimate,
197-
* so punt and just merge them in generically.
197+
* so supply a default estimate for the selectivity
198+
* of the range query. We rather optimistically assume
199+
* that the range is tight...
198200
*/
199-
s1 *= rqlist->hibound * rqlist->lobound;
201+
s1 *= 0.01;
200202
}
201203
}
202204
else

0 commit comments

Comments
 (0)