From: | Robert Haas <robertmhaas(at)gmail(dot)com> |
---|---|
To: | Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> |
Cc: | Andres Freund <andres(at)2ndquadrant(dot)com>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: On partitioning |
Date: | 2014-11-12 21:51:12 |
Message-ID: | CA+TgmoZqndQQQY1U0OBxUOJy1RE_MAawJErghNB7RM8MPgCYDg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Mon, Nov 10, 2014 at 8:53 PM, Amit Langote
<Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp> wrote:
> Above commands are merely transformed into ALTER TABLE subcommands that arrange
> partitioned table and partitions into inheritance hierarchy, but with extra
> information, that is, allowed values for the partition in a new anyarray column
> called 'pg_inherits.values'. A special case of ATExecAddInherit() namely
> ATExecAttachPartitionI(), as part of its processing, also adds partition
> constraints in the form of appropriate CHECK constraints. So, a few of the
> manual steps are automated and additional (IMHO non-opaque) metadata (namely
> partition boundaries/list values) is added.
I thought putting the partition boundaries into pg_inherits was a
strange choice. I'd put it in pg_class, or in pg_partition if we
decide to create that. Maybe as anyarray, but I think pg_node_tree
might even be better. That can also represent data of some arbitrary
type, but it doesn't enforce that everything is uniform. So you could
have a list of objects of the form {RANGEPARTITION :lessthan {CONST
...} :partition 16982} or similar. The relcache could load that up
and convert the list to a C array, which would then be easy to
binary-search.
As you say, you also need to store the relevant operator somewhere,
and the fact that it's a range partition rather than list or hash,
say.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
From | Date | Subject | |
---|---|---|---|
Next Message | Antonin Houska | 2014-11-12 21:52:56 | Re: Unintended restart after recovery error |
Previous Message | Tom Lane | 2014-11-12 21:44:14 | Re: Reverse Engineering - search constraints are not explicitly stated in the tables from the VIEW |