pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sergei Kornilov <sk@zsrv.org>
To: Yudianto Prasetyo <mr.yudianto@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>
Cc: PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Subject: Re: bugs or my fault
Date: Wed, 15 Sep 2021 16:38:53 +0300
Message-ID: <176211631710564@mail.yandex.ru> (raw)
In-Reply-To: <CAN7WH3J_KJNCbC-G644Rqi5Oz0b5LYEpsG4NhZ5yJrh9ioaa+Q@mail.gmail.com>
References: <CAN7WH3LSsm3q_A___SO6=gvOn4-fKCsQvD3E3JrJkTVDm_SbUA@mail.gmail.com>
	<CAN7WH3JUyw1QWX3w+capEJ4v2w3szSnv3SqVD_1c-y-NF=7Lvg@mail.gmail.com>
	<CAHut+PtZ0B6k3+gpvVeOeJLZy3T-wXL6xMyEMXMYNX3wLvu4UQ@mail.gmail.com>
	<CAN7WH3JGfG4UJWVqcx3_VfNA5sg2Oph1HdyaB0oiS9nqYpKWEg@mail.gmail.com>
	<189541631708874@mail.yandex.ru>
	<CAN7WH3J_KJNCbC-G644Rqi5Oz0b5LYEpsG4NhZ5yJrh9ioaa+Q@mail.gmail.com>

We don't do just id % 3, we calculate some hash value from partition key (id) and route the tuple according this hash value. Such condition for your example:

select *, satisfies_hash_partition('myschema.customers'::regclass, 3, 0, id) as modulus3_remainder0_target_partition from myschema.cust0;

Can't illustrate more at the SQL level due to the lack of a uint64 calculations. At C level we are here: https://github.com/postgres/postgres/blob/REL_13_STABLE/src/backend/partitioning/partbounds.c#L4595

regards, Sergei





view thread (8+ messages)  latest in thread

Message-ID: <176211631710564@mail.yandex.ru>
Permalink:  ../176211631710564@mail.yandex.ru/
Also on:    postgresql.org/message-id/176211631710564@mail.yandex.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: sk@zsrv.org, mr.yudianto@gmail.com, smithpb2250@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: bugs or my fault
  In-Reply-To: <176211631710564@mail.yandex.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox