Re: Declarative partitioning - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Declarative partitioning
Date
Msg-id CANP8+jLsxoXEUoL7J5gJGN=pbRf8xeZuqnfAEEO2D4zfsmX3Jg@mail.gmail.com
Whole thread Raw
In response to Re: Declarative partitioning  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Responses Re: Declarative partitioning  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
List pgsql-hackers
On 20 August 2015 at 10:10, Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> wrote:
On 2015-08-20 AM 05:10, Josh Berkus wrote:
> On 08/19/2015 04:59 AM, Simon Riggs wrote:
>> I like the idea of a regular partitioning step because it is how you
>> design such tables - "lets use monthly partitions".
>>
>> This gives sanely terse syntax, rather than specifying pages and pages
>> of exact values in DDL....
>>
>>    PARTITION BY RANGE ON (columns) INCREMENT BY (INTERVAL '1 month' )
>> START WITH value;
>
> Oh, I like that syntax!
>
> How would it work if there were multiple columns?  Maybe we don't want
> to allow that for this form?
>

Yea, we could simply restrict it to the single column case, which does not
sound like a major restriction.

PARTITION BY ...
SUBPARTITION BY ... 

We should plan for that in the way we develop the internals, but full support can wait until later patches.

My view has long been that the internals are they aspect here, not the syntax. We need to be able to have a very fast partition-selection mechanism that can be used in the planner or executor for each tuple. Working backwards, we need a relcache representation that allows that, and a catalog representation that allows that and syntax to match.

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

pgsql-hackers by date:

Previous
From: Pavan Deolasee
Date:
Subject: Re: Declarative partitioning
Next
From: Amit Langote
Date:
Subject: Re: Declarative partitioning