pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Srinivasa T N <seenutn@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: HASH partitioning not working properly
Date: Fri, 19 Jun 2020 09:04:56 +0200
Message-ID: <c8f81436ebf46f083b56af189093872f869f8cf1.camel@cybertec.at> (raw)
In-Reply-To: <CAFruNdeXzVG25yvvpZxBY6_LRgi2azPvAR9qLdnrxNhtVmD+Pg@mail.gmail.com>
References: <CAFruNddApLqb36oUVyHr1BhnN1he1yWUpzqgrT0gPYL_mufB4A@mail.gmail.com>
	<CAApHDvra1kLN=GXc=fA0OHLz3ub2ThXwhe8P7a-Qo3-T73wV0w@mail.gmail.com>
	<CAFruNdeXzVG25yvvpZxBY6_LRgi2azPvAR9qLdnrxNhtVmD+Pg@mail.gmail.com>

On Fri, 2020-06-19 at 12:12 +0530, Srinivasa T N wrote:
> On Fri, Jun 19, 2020 at 11:44 AM David Rowley <dgrowleyml@gmail.com> wrote:
> > On Fri, 19 Jun 2020 at 17:42, Srinivasa T N <seenutn@gmail.com> wrote:
> > >    After seeing the below, I feel partitioning is not working properly or it maybe case that my understanding is wrong.  Can somebody explain me what is happening?
> > 
> > It's your understanding that's not correct.  The value of is passed
> > through a hash function and the partition is selected based partition
> > matching the remainder value after dividing the return value of the
> > hash function by the largest modulus of any partition.
> > 
> > That might surprise you, but how would you select which partition a
> > varchar value should go into if you didn't use a hash function.
> > 
> > David
> 
> How can I see the output of hash function that is used internally?

In the case of "integer", the hash function is "pg_catalog"."hashint4".

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






view thread (10+ messages)  latest in thread

Message-ID: <c8f81436ebf46f083b56af189093872f869f8cf1.camel@cybertec.at>
Permalink:  ../c8f81436ebf46f083b56af189093872f869f8cf1.camel@cybertec.at/
Also on:    postgresql.org/message-id/c8f81436ebf46f083b56af189093872f869f8cf1.camel@cybertec.at

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, seenutn@gmail.com, dgrowleyml@gmail.com
  Subject: Re: HASH partitioning not working properly
  In-Reply-To: <c8f81436ebf46f083b56af189093872f869f8cf1.camel@cybertec.at>
  References: <CAFruNddApLqb36oUVyHr1BhnN1he1yWUpzqgrT0gPYL_mufB4A@mail.gmail.com> <CAApHDvra1kLN=GXc=fA0OHLz3ub2ThXwhe8P7a-Qo3-T73wV0w@mail.gmail.com> <CAFruNdeXzVG25yvvpZxBY6_LRgi2azPvAR9qLdnrxNhtVmD+Pg@mail.gmail.com> <c8f81436ebf46f083b56af189093872f869f8cf1.camel@cybertec.at>

* 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