Hash tables backed by DSA shared memory

Enterprise / PostgreSQL - Andres Freund [anarazel.de] - 23 August 2017 01:43 EDT

Add general purpose chaining hash tables for DSA memory. Unlike DynaHash in shared memory mode, these hash tables can grow as required, and cope with being mapped into different addresses in different backends.

There is a wide range of potential users for such a hash table, though it's very likely the interface will need to evolve as we come to understand the needs of different kinds of users. E.g support for iterators and incremental resizing is planned for later commits and the details of the callback signatures are likely to change.

Author: Thomas Munro

8c0d7ba Hash tables backed by DSA shared memory.
src/backend/lib/Makefile | 4 +-
src/backend/lib/dshash.c | 889 +++++++++++++++++++++++++++++++++++++++
src/include/lib/dshash.h | 107 +++++
src/tools/pgindent/typedefs.list | 7 +
4 files changed, 1005 insertions(+), 2 deletions(-)

Upstream: git.postgresql.org


  • Share