From: Tom Lane Date: Mon, 15 Dec 2008 15:06:31 +0000 (+0000) Subject: Reduce the scaling factor for attstattarget to number-of-lexemes from 100 X-Git-Tag: recoveryinfrav9~207 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=403777de06abc293bf06baea7614127485fcf736;p=users%2Fsimon%2Fpostgres.git 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. --- diff --git a/src/backend/tsearch/ts_typanalyze.c b/src/backend/tsearch/ts_typanalyze.c index b812fd1631..a98a19f405 100644 --- a/src/backend/tsearch/ts_typanalyze.c +++ b/src/backend/tsearch/ts_typanalyze.c @@ -105,7 +105,7 @@ ts_typanalyze(PG_FUNCTION_ARGS) * is no more than a few times w. * * We use a hashtable for the D structure and a bucket width of - * statistics_target * 100, where 100 is an arbitrarily chosen constant, + * statistics_target * 10, where 10 is an arbitrarily chosen constant, * meant to approximate the number of lexemes in a single tsvector. */ static void @@ -130,8 +130,8 @@ compute_tsvector_stats(VacAttrStats *stats, LexemeHashKey hash_key; TrackItem *item; - /* We want statistics_target * 100 lexemes in the MCELEM array */ - num_mcelem = stats->attr->attstattarget * 100; + /* We want statistics_target * 10 lexemes in the MCELEM array */ + num_mcelem = stats->attr->attstattarget * 10; /* * We set bucket width equal to the target number of result lexemes.