pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: no default hash partition
Date: Tue, 6 Aug 2019 19:02:28 -0400
Message-ID: <20190806230228.GE29202@tamriel.snowman.net> (raw)
In-Reply-To: <16738.1565132324@sss.pgh.pa.us>
References: <20190806225310.GA17708@alvherre.pgsql>
	<16738.1565132324@sss.pgh.pa.us>

Greetings,

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> > On 2019-Aug-06, Tom Lane wrote:
> >> Seems like "it's likely to cause trouble for users" is just going to
> >> beg the question "why?".  Can we explain the hazard succinctly?
> >> Or point to a comment somewhere else that explains it?
> 
> > Right ... the "trouble" is just that if the user later wants to add the
> > missing partitions, they'll need to acquire some strong lock (IIRC it's AEL)
> > in the partitioned table, so it effectively means an outage.  With
> > list/range partitioning, there's the slight advantage that you don't
> > have to guess all your partitions in advance, or cover data values that
> > are required for a very small number of rows.  In hash partitioning you
> > can't really predict which values are those going to be, and the set of
> > missing partitions is perfectly known.
> 
> Hmm.  So given the point about it being hard to predict which hash
> partitions would receive what values ... under what circumstances
> would it be sensible to not create a full set of partitions?  Should
> we just enforce that there is a full set, somehow?

I imagine there's good reasons this wasn't just done (for this or
various other things), but couldn't we enforce it by just creating them
all..?  Sure would simplify a lot of things for users.  Similairly for
list partitions, I would think.  Again, I feel like there's probably a
reason why it doesn't just work(tm) like that, but it sure would be
nice.

Of course, there's the other side of things where it'd sure be nice to
automatically have partitions created for time-based partitions when
appropriate (yes, basically doing what pg_partman already does, but in
core somehow..), but for hash partitions we don't need to deal with
that.

Thanks,

Stephen

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (23+ messages)  latest in thread

Message-ID: <20190806230228.GE29202@tamriel.snowman.net>
Permalink:  ../20190806230228.GE29202@tamriel.snowman.net/
Also on:    postgresql.org/message-id/20190806230228.GE29202@tamriel.snowman.net

 · 

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-hackers@postgresql.org
  Cc: sfrost@snowman.net, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com
  Subject: Re: no default hash partition
  In-Reply-To: <20190806230228.GE29202@tamriel.snowman.net>
  References: <20190806225310.GA17708@alvherre.pgsql> <16738.1565132324@sss.pgh.pa.us> <20190806230228.GE29202@tamriel.snowman.net>

* 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