Re: [POC] hash partitioning

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
Cc: David Steele <david(at)pgmasters(dot)net>, amul sul <sulamul(at)gmail(dot)com>, Greg Stark <stark(at)mit(dot)edu>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [POC] hash partitioning
Date: 2017-04-13 20:40:29
Message-ID: CA+TgmoZ6i4VO5_vJoWoSrN8Cn3gYWmWhZ4w4mUjytTsvXQYUFw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 17, 2017 at 7:57 AM, Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp> wrote:
> I also understanded that my design has a problem during pg_dump and
> pg_upgrade, and that some information to identify the partition
> is required not depending the command order. However, I feel that
> Amul's design is a bit complicated with the rule to specify modulus.
>
> I think we can use simpler syntax, for example, as below.
>
> CREATE TABLE h1 PARTITION OF h FOR (0);
> CREATE TABLE h2 PARTITION OF h FOR (1);
> CREATE TABLE h3 PARTITION OF h FOR (2);

I don't see how that can possibly work. Until you see all the table
partitions, you don't know what the partitioning constraint for any
given partition should be, which seems to me to be a fatal problem.

I agree that Amul's syntax - really, I proposed it to him - is not the
simplest, but I think all the details needed to reconstruct the
partitioning constraint need to be explicit. Otherwise, I'm pretty
sure things we're going to have lots of problems that we can't really
solve cleanly. We can later invent convenience syntax that makes
common configurations easier to set up, but we should invent the
syntax that spells out all the details first.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2017-04-13 20:42:23 Re: Cutting initdb's runtime (Perl question embedded)
Previous Message Andres Freund 2017-04-13 20:39:07 Re: Quals not pushed down into lateral