Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb71761d

Browse files
committed
Reduce eqsel()'s fudge-factor for estimating the frequency of values
other than the most common value in a column. We had had 0.5, make it0.1 to make it more likely that an indexscan will be chosen. Reallyneed better statistics instead, but this should stem the bleedingmeanwhile ...
1 parentbe6e771 commitb71761d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

‎src/backend/utils/adt/selfuncs.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.65 2000/04/16 04:41:02 tgl Exp $
18+
* $Header: /cvsroot/pgsql/src/backend/utils/adt/selfuncs.c,v 1.66 2000/05/26 17:19:15 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -55,6 +55,9 @@
5555
/* default selectivity estimate for pattern-match operators such as LIKE */
5656
#defineDEFAULT_MATCH_SEL0.01
5757

58+
/* "fudge factor" for estimating frequency of not-most-common values */
59+
#defineNOT_MOST_COMMON_RATIO 0.1
60+
5861
staticboolconvert_to_scalar(Datumvalue,Oidvaluetypid,double*scaledvalue,
5962
Datumlobound,Datumhibound,Oidboundstypid,
6063
double*scaledlobound,double*scaledhibound);
@@ -190,7 +193,7 @@ eqsel(Oid opid,
190193
* exactly!
191194
*/
192195
if (typid!=BOOLOID)
193-
selec *=0.5;
196+
selec *=NOT_MOST_COMMON_RATIO;
194197
}
195198
}
196199
else
@@ -209,7 +212,7 @@ eqsel(Oid opid,
209212
* and in fact it's probably less, so apply a fudge
210213
* factor.
211214
*/
212-
selec *=0.5;
215+
selec *=NOT_MOST_COMMON_RATIO;
213216
}
214217

215218
/* result should be in range, but make sure... */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp