Content-Length: 265274 | pFad | http://github.com/postgrespro/postgres/commit/84f1b0b031e6914c41623102b93fed8ab0e51253

97 Accommodate very large dshash tables. · postgrespro/postgres@84f1b0b · GitHub
Skip to content

Commit 84f1b0b

Browse files
Accommodate very large dshash tables.
If a dshash table grows very large (e.g., the dshash table for cumulative statistics when there are millions of tables), resizing it may fail with an error like: ERROR: invalid DSA memory alloc request size 1073741824 To fix, permit dshash resizing to allocate more than 1 GB by providing the DSA_ALLOC_HUGE flag. Reported-by: Andreas Scherbaum Author: Matthias van de Meent Reviewed-by: Cédric Villemain, Michael Paquier, Andres Freund Discussion: https://postgr.es/m/80a12d59-0d5e-4c54-866c-e69cd6536471%40pgug.de Backpatch-through: 13
1 parent 7a80e38 commit 84f1b0b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/backend/lib/dshash.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,10 @@ resize(dshash_table *hash_table, size_t new_size_log2)
887887
Assert(new_size_log2 == hash_table->control->size_log2 + 1);
888888

889889
/* Allocate the space for the new table. */
890-
new_buckets_shared = dsa_allocate0(hash_table->area,
891-
sizeof(dsa_pointer) * new_size);
890+
new_buckets_shared =
891+
dsa_allocate_extended(hash_table->area,
892+
sizeof(dsa_pointer) * new_size,
893+
DSA_ALLOC_HUGE | DSA_ALLOC_ZERO);
892894
new_buckets = dsa_get_address(hash_table->area, new_buckets_shared);
893895

894896
/*

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/84f1b0b031e6914c41623102b93fed8ab0e51253

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy