Skip site navigation (1) Skip section navigation (2)

Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1

From: "Jaime Casanova" <jcasanov(at)systemguards(dot)com(dot)ec>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>
Cc: "Gregory Stark" <stark(at)enterprisedb(dot)com>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Nikhil Sontakke" <nikhil(dot)sontakke(at)enterprisedb(dot)com>, "Emmanuel Cecchet" <manu(at)frogthinker(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1
Date: 2008-11-27 15:10:38
Message-ID: 3073cc9b0811270710p3a2e5ae9s10f66b529550c03e@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Thu, Nov 27, 2008 at 9:41 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Thu, Nov 27, 2008 at 8:31 AM, Gregory Stark <stark(at)enterprisedb(dot)com> wrote:
>>> CREATE PARTITION transaction_2008_11 ON transaction WHERE record_date
>>> BETWEEN '2008-11-01' AND '2008-11-30';
>>
>> I think the main advantage to a better partitioning method would be teaching
>> Postgres about the partition key. Instead of a collection of different
>> constraints Postgres would know that "record_date" is *always* the partition
>> key. So it wouldn't have to be specified every time you declare a partition.
>
> Hmm...  I thought the main advantage would be that you wouldn't have
> to manually add constraints to all of the child tables, and you
> wouldn't have to manually add rules/triggers to the parent table to
> redirect DML operations.
>

ok. what about let CREATE TABLE WITH PARTITIONING to create an entry
in a catalog indicating the key of the partition and install the
triggers and let the trigger decide if it has the partition to insert
the new row (making UPDATE working almost as DELETE+INSERT if it needs
to change of partitions) or create the new partition maybe with an
apropiate CREATE PARTITION...

that way i don't need to create triggers nor inherit tables
manually... and because of that maybe we can make possible to add
<expr> as partition key...


PS: i'm against using CREATE TABLE because we are inventing new syntax
but it seems like using ALTER TABLE is a *lot* of work altough ISTM
more usefull

-- 
Atentamente,
Jaime Casanova
Soporte y capacitación de PostgreSQL
Asesoría y desarrollo de sistemas
Guayaquil - Ecuador
Cel. +59387171157

In response to

Responses

pgsql-hackers by date

Next:From: Jaime CasanovaDate: 2008-11-27 15:12:13
Subject: Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1
Previous:From: Robert HaasDate: 2008-11-27 14:47:27
Subject: Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1

pgsql-patches by date

Next:From: Jaime CasanovaDate: 2008-11-27 15:12:13
Subject: Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1
Previous:From: Robert HaasDate: 2008-11-27 14:47:27
Subject: Re: Fwd: [PATCHES] Auto Partitioning Patch - WIP version 1

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group