Hash index with larger hashes - Mailing list pgsql-hackers

From Kenneth Marshall
Subject Hash index with larger hashes
Date
Msg-id 20160805143917.GB19351@aart.rice.edu
Whole thread Raw
Responses Re: Hash index with larger hashes  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
Hello Developers,

I have been following the recent discussions on increasing the
size of the hash function used in Postgres and the work to
provide WAL and performance improvements for hash indexes. 
I know it was mentioned when we moved to the new hashing
functions, but the existing functions do provide an additional
32-bits of hash. We currently do not use them, but they are
already calculated.

It had occurred to me that one way to decrease the space used
to store the hash value would be to include information about
the page number to determine the actual value. For example,
a hash index of 65k pages (540mb) would get two additional
bytes of hash with no associated storage cost. Also, if you
subdivided the hash page into say 128 sub-pages you would
get the extra 2 bytes of hash in a 4mb index. In this way,
the bigger the hash index is, the more bits you get for free.

Just wanted to throw it out there.

Regards,
Ken



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: truncate trigger for foreign data wrappers
Next
From: Peter Eisentraut
Date:
Subject: Re: pg_size_pretty, SHOW, and spaces