8000 Reduce hash size for compute_array_stats, compute_tsvector_stats. · jandas/postgres@85efd5f · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 85efd5f

Browse files
committed
Reduce hash size for compute_array_stats, compute_tsvector_stats.
The size is only a hint, but a big hint chews up a lot of memory without apparently improving performance much. Analysis and patch by Noah Misch.
1 parent 9d435d5 commit 85efd5f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/backend/tsearch/ts_typanalyze.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ compute_tsvector_stats(VacAttrStats *stats,
186186
hash_ctl.match = lexeme_match;
187187
hash_ctl.hcxt = CurrentMemoryContext;
188188
lexemes_tab = hash_create("Analyzed lexemes table",
189-
bucket_width * 7,
189+
num_mcelem,
190190
&hash_ctl,
191191
HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
192192

src/backend/utils/adt/array_typanalyze.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
282282
elem_hash_ctl.match = element_match;
283283
elem_hash_ctl.hcxt = CurrentMemoryContext;
284284
elements_tab = hash_create("Analyzed elements table",
285-
bucket_width * 7,
285+
num_mcelem,
286286
&elem_hash_ctl,
287287
HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
288288

0 commit comments

Comments
 (0)
0