Re: Auto creation of Partitions

From: Shane Ambler <pgsql(at)Sheeky(dot)Biz>
To: "Jim C(dot) Nasby" <jim(at)nasby(dot)net>
Cc: NikhilS <nikkhils(at)gmail(dot)com>, Jim Nasby <decibel(at)decibel(dot)org>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Auto creation of Partitions
Date: 2007-03-08 22:01:10
Message-ID: 45F087A6.3010107@Sheeky.Biz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Jim C. Nasby wrote:
> On Thu, Mar 08, 2007 at 01:52:27PM +0530, NikhilS wrote:
>>> I think it'd be great to make adding and removing partitions as
>>> simple as ALTER TABLE. I don't think that DELETE should be the
>>> mechanism to drop a partition, though. Again, DML statements
>>> shouldn't be performing DDL.
>>
>> Since partition is inheritance-based, a simple DROP or "NO INHERIT" will do
>> the job to deal with the partition. Do we want to reinvent additional syntax
>> when these are around and are documented?
>
> Well, if the syntax for adding a new partition eventually ends up as
> ALTER TABLE ADD PARTITION, then it would make more sense that you remove
> a partition via ALTER TABLE DROP PARTITION.

This follows on from the suggestion I made - taken along the lines of
the subject "auto creation of partitions" where I suggested the syntax
of partition check(month of mydatecol) and have a new partition created
as data was entered. With this scenario dropping the partition when it
was empty would complement the creation of a new partition as needed.

Given that there seems to be no real support of going with "auto
maintenance" were new partitions are added as needed, then the auto
dropping of empty partitions would also not apply.

Leaving us with only specific add partition / drop partition commands.
And have the parent table pick up rows not matching any partition check
criteria.

--

Shane Ambler
pgSQL(at)Sheeky(dot)Biz

Get Sheeky @ http://Sheeky.Biz

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Neil Conway 2007-03-08 22:39:38 Re: Estimating seq_page_fetch and random_page_fetch
Previous Message Hideyuki Kawashima 2007-03-08 21:17:46 Re: Acclerating INSERT/UPDATE using UPS

Browse pgsql-patches by date

  From Date Subject
Next Message Mark Stosberg 2007-03-09 02:30:22 suggestion for improving TMPDIR and "--format" docs for pg_dump
Previous Message Shane Ambler 2007-03-08 20:10:29 Re: Auto creation of Partitions