Re: Declarative partitioning - another take

From: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
To: Amit Langote <amitlangote09(at)gmail(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>
Cc: Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Declarative partitioning - another take
Date: 2016-09-09 08:55:48
Message-ID: 28ee345c-1278-700e-39a7-36a71f9a3b43@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2016/09/06 22:04, Amit Langote wrote:
> Will fix.

Here is an updated set of patches.

In addition to fixing a couple of bugs reported by Ashutosh and Rajkumar,
there are a few of major changes:

* change the way individual partition bounds are represented internally
and the way a collection of partition bounds associated with a
partitioned table is exposed to other modules. Especially list
partition bounds which are manipulated more efficiently as discussed
at [1].

* \d partitioned_table now shows partition count and \d+ lists partition
names and their bounds as follows:

\d t6
Table "public.t6"
Column | Type | Modifiers
.-------+-------------------+-----------
a | integer |
b | character varying |
Partition Key: LIST (a)
Number of partitions: 3 (Use \d+ to list them.)

\d+ t6
Table "public.t6"
Column | Type | Modifiers | Storage | Stats target |
Description
.-------+-------------------+-----------+----------+--------------+-------------
a | integer | | plain | |
b | character varying | | extended | |
Partition Key: LIST (a)
Partitions: t6_p1 FOR VALUES IN (1, 2, NULL),
t6_p2 FOR VALUES IN (4, 5),
t6_p3 FOR VALUES IN (3, 6)

\d+ p
Table "public.p"
Column | Type | Modifiers | Storage | Stats target | Description
.-------+--------------+-----------+----------+--------------+-------------
a | integer | | plain | |
b | character(1) | | extended | |
Partition Key: RANGE (a)
Partitions: p1 FOR VALUES START (1) END (10),
p2 FOR VALUES START (10) END (20),
p3 FOR VALUES START (20) END (30),
p4 FOR VALUES START (30) EXCLUSIVE END (40) INCLUSIVE,
p5 FOR VALUES START (40) EXCLUSIVE END (50),
p6 FOR VALUES START (50) END UNBOUNDED

* Some more regression tests

Thanks,
Amit

[1]
https://www.postgresql.org/message-id/CA%2BTgmoZCr0-t93KgJA3T1uy9yWxfYaSYL3X35ObyHg%2BZUfERqQ%40mail.gmail.com

Attachment Content-Type Size
0001-Catalog-and-DDL-for-partitioned-tables-4.patch text/x-diff 115.9 KB
0002-psql-and-pg_dump-support-for-partitioned-tables-4.patch text/x-diff 22.5 KB
0003-Catalog-and-DDL-for-partitions-4.patch text/x-diff 205.8 KB
0004-psql-and-pg_dump-support-for-partitions-4.patch text/x-diff 20.6 KB
0005-Refactor-optimizer-s-inheritance-set-expansion-code-4.patch text/x-diff 14.5 KB
0006-Teach-a-few-places-to-use-partition-check-quals-4.patch text/x-diff 30.2 KB
0007-Introduce-a-PartitionTreeNode-data-structure-4.patch text/x-diff 8.0 KB
0008-Tuple-routing-for-partitioned-tables-4.patch text/x-diff 41.5 KB
0009-Update-DDL-Partitioning-chapter-to-reflect-new-devel-4.patch text/x-diff 24.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2016-09-09 09:23:28 Re: Quorum commit for multiple synchronous replication.
Previous Message Victor Wagner 2016-09-09 08:49:53 Re: Patch: Implement failover on libpq connect level.