Hash Function

Started by Ravi Kiranabout 11 years ago2 messages
#1Ravi Kiran
ravi.kolanpaka@gmail.com

Hi,

I want to know what kind of hash function postgres is using currently, can
someone please explain the algorithm postgres is using for the hash
function in the hash join algorithm.

Thanks,

K.Ravikiran

#2Jim Nasby
Jim.Nasby@BlueTreble.com
In reply to: Ravi Kiran (#1)
Re: Hash Function

On 1/11/15 8:52 AM, Ravi Kiran wrote:

Hi,

I want to know what kind of hash function postgres is using currently, can someone please explain the algorithm postgres is using for the hash function in the hash join algorithm.

That's ultimately going to be determined by the operator family of the data types involved in the join, but generally stuff uses the internal hash function which is a modified Jenkins hash.

BTW, I just investigated switching the algorithm we use for buffer hashing [1]/messages/by-id/24160.1419460117@sss.pgh.pa.us -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com. Turned out to be a dead end, but it's very possible that a newer hash than Jenkins (ie: CityHash or FarmHash) would be a win for larger data.

[1]: /messages/by-id/24160.1419460117@sss.pgh.pa.us -- Jim Nasby, Data Architect, Blue Treble Consulting Data in Trouble? Get it in Treble! http://BlueTreble.com
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers