Skip to content

Commit 301194f

Browse files
committed
Reduce the scaling factor for attstattarget to number-of-lexemes from 100
to 10, to compensate for the recent change in default statistics target. The original number was pulled out of the air anyway :-(, but it was picked in the context of the old default, so holding the default size of the MCELEM array constant seems the best thing. Per discussion.
1 parent b4d64a6 commit 301194f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/backend/tsearch/ts_typanalyze.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/tsearch/ts_typanalyze.c,v 1.4 2008/12/13 19:13:44 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/tsearch/ts_typanalyze.c,v 1.5 2008/12/15 15:06:31 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -105,7 +105,7 @@ ts_typanalyze(PG_FUNCTION_ARGS)
105105
* is no more than a few times w.
106106
*
107107
* We use a hashtable for the D structure and a bucket width of
108-
* statistics_target * 100, where 100 is an arbitrarily chosen constant,
108+
* statistics_target * 10, where 10 is an arbitrarily chosen constant,
109109
* meant to approximate the number of lexemes in a single tsvector.
110110
*/
111111
static void
@@ -130,8 +130,8 @@ compute_tsvector_stats(VacAttrStats *stats,
130130
LexemeHashKey hash_key;
131131
TrackItem *item;
132132

133-
/* We want statistics_target * 100 lexemes in the MCELEM array */
134-
num_mcelem = stats->attr->attstattarget * 100;
133+
/* We want statistics_target * 10 lexemes in the MCELEM array */
134+
num_mcelem = stats->attr->attstattarget * 10;
135135

136136
/*
137137
* We set bucket width equal to the target number of result lexemes.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy