mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
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.
This commit is contained in:
@ -186,7 +186,7 @@ compute_tsvector_stats(VacAttrStats *stats,
|
|||||||
hash_ctl.match = lexeme_match;
|
hash_ctl.match = lexeme_match;
|
||||||
hash_ctl.hcxt = CurrentMemoryContext;
|
hash_ctl.hcxt = CurrentMemoryContext;
|
||||||
lexemes_tab = hash_create("Analyzed lexemes table",
|
lexemes_tab = hash_create("Analyzed lexemes table",
|
||||||
bucket_width * 7,
|
num_mcelem,
|
||||||
&hash_ctl,
|
&hash_ctl,
|
||||||
HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
|
HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
|
||||||
|
|
||||||
|
@ -282,7 +282,7 @@ compute_array_stats(VacAttrStats *stats, AnalyzeAttrFetchFunc fetchfunc,
|
|||||||
elem_hash_ctl.match = element_match;
|
elem_hash_ctl.match = element_match;
|
||||||
elem_hash_ctl.hcxt = CurrentMemoryContext;
|
elem_hash_ctl.hcxt = CurrentMemoryContext;
|
||||||
elements_tab = hash_create("Analyzed elements table",
|
elements_tab = hash_create("Analyzed elements table",
|
||||||
bucket_width * 7,
|
num_mcelem,
|
||||||
&elem_hash_ctl,
|
&elem_hash_ctl,
|
||||||
HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
|
HASH_ELEM | HASH_FUNCTION | HASH_COMPARE | HASH_CONTEXT);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user