Partition by hash formula

From: Vlad Bokov <vlad(at)razum2um(dot)me>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Partition by hash formula
Date: 2020-03-20 09:50:04
Message-ID: c4d46ba3-d8b4-6659-f163-110bdd2184b4@razum2um.me
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

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?

Thanks,
Vlad

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gergely Riskó 2020-03-20 11:22:51 promise postgres that I will only ROLLBACK
Previous Message Matt Magoffin 2020-03-20 09:17:40 Duplicate key violation on upsert