Re: Partition by hash formula - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Partition by hash formula
Date
Msg-id 228515d1e1204eda0844a05fbe0c0d7e10c34c87.camel@cybertec.at
Whole thread Raw
In response to Partition by hash formula  (Vlad Bokov <vlad@razum2um.me>)
List pgsql-general
On Fri, 2020-03-20 at 12:50 +0300, Vlad Bokov wrote:
> recently I read
> https://blog.dbi-services.com/hash-partitioning-in-postgresql-11/
> and reproduced steps from the, which gave exact same count outcome,
> which made me think
> hashing is a pure function.
> 
> Examined the data I saw following distribution:
> dept_1: 1,14,39...; dept_2: 3,11,21...; dept_3: 16,18,25...
> 
> I also found commit 1aba8e651a introducing the feature, but I'm not too
> much into internals.
> I wonder, could somebody write that hashing formula in pseudo-code or
> point to specific place in the code, please?

Look for the int4hashfast, texthashfast and similar functions in
src/backend/utils/cache/catcache.c

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-general by date:

Previous
From: Laurenz Albe
Date:
Subject: Re: Wal receiver process listens to physical IP
Next
From: Ravi Krishna
Date:
Subject: How to get RAISE INFO in JDBC