Re: Declarative partitioning grammar

From: "Zeugswetter Andreas ADI SD" <Andreas(dot)Zeugswetter(at)s-itsolutions(dot)at>
To: "Markus Schiltknecht" <markus(at)bluegap(dot)ch>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Jeff Cohen" <jcohen(at)greenplum(dot)com>, "Warren Turkal" <turkal(at)google(dot)com>, "Ron Mayer" <rm_pg(at)cheapcomplexdevices(dot)com>, "Gavin Sherry" <swm(at)alcove(dot)com(dot)au>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Declarative partitioning grammar
Date: 2008-01-16 13:13:41
Message-ID: E1539E0ED7043848906A8FF995BDA57902B626BE@m0143.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> > Personally I find the automatic partition idea intriguing, where you
> > only have to choose an expression that equates to one value (value
> > group) per partition (and possibly a way to derive a
> partition name).
>
> IMO, better go right to a fully automated approach. Or why would you
> need partition names in such a case?

Yes, I tend to aggree on that, with the exception that I think the
partition borders should be declarative expressions (equal in syntax to
a GROUP BY clause).

Names are only for a short and crisp way to identify the partition for
the following operations:
- drop/detach data in a partition (as opposed to a normal delete)
- move to/create in other tablespace (I don't value that one, but others
have)
- reorg, create index

The drop can probably be done straight from a normal delete (a problem
is RI and triggers though).
The normal delete would need to have the smarts, that a delete covers a
whole partition, and thus mark the whole partition dead instead of it's
individual rows.

A detach would need some extra syntax, but could also be based on a
where clause that specifies which partitions are to be detached. I am
not so sure about how to usefully do the reorg part with where clauses.

Andreas

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-01-16 13:32:12 Re: Password policy
Previous Message Heikki Linnakangas 2008-01-16 11:44:48 Re: Some ideas about Vacuum