[HACKERS] New partitioning - some feedback

Поиск
Список
Период
Сортировка
От Mark Kirkwood
Тема [HACKERS] New partitioning - some feedback
Дата
Msg-id 6d0e4eb7-c2a9-c4cd-f9bc-1a1722f878d2@catalyst.net.nz
обсуждение исходный текст
Ответы Re: [HACKERS] New partitioning - some feedback  (Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>)
Re: [HACKERS] New partitioning - some feedback  (Vik Fearing <vik.fearing@2ndquadrant.com>)
Список 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                  |           |
notnull | dte    | timestamp with time zone |           | not null | val    | integer                  |           |
notnull |
 
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




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joe Conway
Дата:
Сообщение: Re: [HACKERS] Multi column range partition table
Следующее
От: Amit Langote
Дата:
Сообщение: Re: [HACKERS] Multi column range partition table