Re: On partitioning - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: On partitioning
Date
Msg-id 20141210142225.GW1768@alvh.no-ip.org
Whole thread Raw
In response to Re: On partitioning  ("Amit Langote" <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: On partitioning  (Robert Haas <robertmhaas@gmail.com>)
Re: On partitioning  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
Amit Langote wrote:

> On Wed, Dec 10, 2014 at 12:46 PM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> > On Tue, Dec 9, 2014 at 7:21 PM, Alvaro Herrera <alvherre@2ndquadrant.com>
> > wrote:

> >> FWIW in my original proposal I was rejecting some things that after
> >> further consideration turn out to be possible to allow; for instance
> >> directly referencing individual partitions in COPY.  We could allow
> >> something like
> >>
> >> COPY lineitems PARTITION FOR VALUE '2000-01-01' TO STDOUT
> >> or maybe
> >> COPY PARTITION FOR VALUE '2000-01-01' ON TABLE lineitems TO STDOUT
> >>
> > or
> > COPY [TABLE] lineitems PARTITION FOR VALUE '2000-01-01'  TO STDOUT
> > COPY [TABLE] lineitems PARTITION <part_1,part_2,>  TO STDOUT
> >
> > I think we should try to support operations on partitions via main
> > table whereever it is required.

Um, I think the only difference is that you added the noise word TABLE
which we currently don't allow in COPY, and that you added the
possibility of using named partitions, about which see below.

> We can also allow to explicitly name a partition
> 
> COPY [TABLE ] lineitems PARTITION lineitems_2001 TO STDOUT;

The problem with naming partitions is that the user has to pick names
for every partition, which is tedious and doesn't provide any
significant benefit.  The input I had from users of other partitioning
systems was that they very much preferred not to name the partitions at
all, which is why I chose the PARTITION FOR VALUE syntax (not sure if
this syntax is exactly what other systems use; it just seemed the
natural choice.)

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



pgsql-hackers by date:

Previous
From: Rahila Syed
Date:
Subject: Re: [REVIEW] Re: Compression of full-page-writes
Next
From: Alvaro Herrera
Date:
Subject: Re: logical column ordering