Re: Auto creation of Partitions

From: NikhilS <nikkhils(at)gmail(dot)com>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: "Peter Eisentraut" <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Auto creation of Partitions
Date: 2007-03-07 11:52:57
Message-ID: d3c4af540703070352k4bd631deyd328050f60678430@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi,

If you know that the constraints on each of the tables is distinct, then
> building a UNIQUE index on each of the partitions is sufficient to prove
> that all rows in the combined partitioned table are distinct also.
>
> The hard part there is checking that the partition constraints are
> distinct. If the partition constraints are added one at a time, you can
> use the predicate testing logic to compare the to-be-added partition's
> constraint against each of the already added constraints. That becomes
> an O(N) problem.
>
> What is really needed is a data structure that allows range partitions
> to be accessed more efficiently. This could make adding partitions and
> deciding in which partition a specific value goes an O(logN) operation.

If the unique constraint is supposed to be on a column which is NOT being
used for the partitioning, then all the above becomes much more difficult.
While partitioning, the additional onus on the user is to specify
non-conflicting CHECKs for the range/list partitions.

Regards,
Nikhils

--
> Simon Riggs
> EnterpriseDB http://www.enterprisedb.com
>
>
>

--
EnterpriseDB http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Grzegorz Jaskiewicz 2007-03-07 11:53:08 Re: Grouped Index Tuples / Clustered Indexes
Previous Message Тимчишин Виталий 2007-03-07 11:10:07 Re: [JDBC] Plan invalidation vs. unnamed prepared statements

Browse pgsql-patches by date

  From Date Subject
Next Message Zeugswetter Andreas ADI SD 2007-03-07 13:34:16 Re: Auto creation of Partitions
Previous Message Simon Riggs 2007-03-07 10:26:40 Re: Auto creation of Partitions