New partitioning - some feedback

From: Mark Kirkwood <mark(dot)kirkwood(at)catalyst(dot)net(dot)nz>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: New partitioning - some feedback
Date: 2017-07-07 00:02:28
Message-ID: 6d0e4eb7-c2a9-c4cd-f9bc-1a1722f878d2@catalyst.net.nz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I've been trying out the new partitioning in version 10. Firstly, I must
say this is excellent - so much nicer than the old inheritance based method!

My only niggle is the display of partitioned tables via \d etc. e.g:

part=# \d
List of relations
Schema | Name | Type | Owner
--------+----------------------+-------+----------
public | date_fact | table | postgres
public | date_fact_201705 | table | postgres
public | date_fact_201706 | table | postgres
public | date_fact_20170601 | table | postgres
public | date_fact_2017060100 | table | postgres
public | date_fact_201707 | table | postgres
public | date_fact_rest | table | postgres
(7 rows)

Now it can be inferred from the names that date_fact is a partitioned
table and the various date_fact_dddd are its partitions - but \d is not
providing any hints of this. The more detailed individual describe is fine:

part=# \d date_fact
Table "public.date_fact"
Column | Type | Collation | Nullable | Default
--------+--------------------------+-----------+----------+---------
id | integer | | not null |
dte | timestamp with time zone | | not null |
val | integer | | not null |
Partition key: RANGE (dte)
Number of partitions: 6 (Use \d+ to list them.)

I'd prefer *not* to see a table and its partitions all intermixed in the
same display (especially with nothing indicating which are partitions) -
as this will make for unwieldy long lists when tables have many
partitions. Also it would be good if the 'main' partitioned table and
its 'partitions' showed up as a different type in some way.

I note the they do in pg_class:

part=# SELECT relname,relkind,relispartition FROM pg_class WHERE relname
LIKE 'date_fact%';
relname | relkind | relispartition
----------------------+---------+----------------
date_fact | p | f
date_fact_201705 | r | t
date_fact_201706 | r | t
date_fact_20170601 | r | t
date_fact_2017060100 | r | t
date_fact_201707 | r | t
date_fact_rest | r | t
(7 rows)

...so it looks to be possible to hide the partitions from the main
display and/or mark them as such. Now I realize that making this comment
now that beta is out is a bit annoying - apologies, but I think seeing a
huge list of 'tables' is going to make \d frustrating for folk doing
partitioning.

regards

Mark

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2017-07-07 01:06:18 Re: Multi column range partition table
Previous Message Joe Conway 2017-07-06 21:43:44 Re: Multi column range partition table