Re: hash function in Postgres

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ravi Kiran <ravi(dot)kolanpaka(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: hash function in Postgres
Date: 2015-01-24 15:03:26
Message-ID: 54C3B43E.6030007@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 01/23/2015 10:42 PM, Ravi Kiran wrote:
> hi,
>
>
> I want to know what kind of hash function postgresql uses while joining.
> I was debugging through gdb, I found out that it is not using bob
> jenkins hash function but a different hash function *hash_uint32() and
> hash_any() *functions if the joining attribute is an integer, and a
> different kind of hash function for a different type of joining attribute.
>
> I want to know whether the hash functions will change if the number of
> tuples in the table are very large or very low, and if it changes,
> please tell me what hash function it uses if the tuples are very large
> and what hash function it uses if the number is very low, also I came to
> know that the hash function will change depending on the type of the
> attribute on which the join takes place, but will it always remains the
> same for the integer type of joining attribute or will it it change.

Seems a good starting point is here:

http://git.postgresql.org/gitweb/?p=postgresql.git;a=tree;f=src/backend/access/hash;h=6e44d337d3dc3e8d5439e2dbbc54ce0c33d3b5d4;hb=8ca336f4ac3f08a5f23e76c6e9a5f2c8064f5883

In particular, hashfunc.c

>
> thanks
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2015-01-24 15:26:41 Re: CLOG read problem after pg_basebackup
Previous Message Pavel Stehule 2015-01-24 10:30:55 Re: Postgresql 9.4 session vars