Re: Auto creation of Partitions

From: "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>
To: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, <pgsql-hackers(at)postgresql(dot)org>
Cc: "NikhilS" <nikkhils(at)gmail(dot)com>
Subject: Re: Auto creation of Partitions
Date: 2007-03-07 13:34:16
Message-ID: E1539E0ED7043848906A8FF995BDA57901D42CF3@m0143.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


> > iv) Based on the PRIMARY, UNIQUE, REFERENCES information specified,
> > pass it on to the children tables.
>
> How will you maintain a primary key in such a table,
> considering that indexes can't span multiple tables?

Many partitioning schemes have (or can be made to have) only one
possible target partition for the primary key. Thus if you create
separate unique indexes on each partition the problem is solved.
For a first version I opt, that it is sufficient to disallow creation of
a unique index on the master, when the constraints (on columns of this
index) do not nail down a specific partition for each row (e.g. a hash
or a range on one of the index columns that does not overlap).
Later, global index, or indexes with separate partitioning rules can be
implemented, that cover the other cases.

Andreas

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Luke Lonergan 2007-03-07 14:02:01 Re: Grouped Index Tuples / Clustered Indexes
Previous Message Grzegorz Jaskiewicz 2007-03-07 11:53:08 Re: Grouped Index Tuples / Clustered Indexes

Browse pgsql-patches by date

  From Date Subject
Next Message NikhilS 2007-03-07 14:29:48 Re: Auto creation of Partitions
Previous Message NikhilS 2007-03-07 11:52:57 Re: Auto creation of Partitions