On Fri, Aug 20, 2021 at 1:52 PM alvhe...@alvh.no-ip.org
<alvhe...@alvh.no-ip.org> wrote:
> Actually, you were right.  Hash tables in shared memory can be expanded.
> There are some limitations (the hash "directory" is fixed size, which
> means the hash table get less efficient if it grows too much), but you
> can definitely create more hash entries than the initial size.  See for
> example element_alloc(), which covers the case of a hash table being
> IS_PARTITIONED -- something that only shmem hash tables can be.  Note
> that ShmemInitHash passes the HASH_ALLOC flag and uses ShmemAllocNoError
> as allocation function, which acquires memory from the shared segment.

I realize that the code supports this ... but I thought we had
established a policy that only the main lock manager's shared hash
tables, and not any others, are actually allowed to make use of this
functionality.  See commit 7c797e7194d969f974abf579cacf30ffdccdbb95.

It seems like a dangerous thing to rely on in any case, since we can't
predict how much extra shared memory might actually be available.

-- 
Robert Haas
EDB: http://www.enterprisedb.com


Reply via email to