Partitioned Table Index Column Order

Поиск
Список
Период
Сортировка
От Rumpi Gravenstein
Тема Partitioned Table Index Column Order
Дата
Msg-id CAEpg1wCbZJCCYL0cesn00bCGdOsB0Q66_-3O=2TSwqGDiD-Zow@mail.gmail.com
обсуждение исходный текст
Ответы Re: Partitioned Table Index Column Order  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-general
All,

I'm on PostgreSQL 13 and have a partitioned table with a primary key.  

create table t( a integer, b integer, c varchar, d .. ) partitioned by range( a );

As a best practice is it better to create the primary key starting or ending with the partition column?

e.g. 
1)  t_pkey primary key (a, b, c)

or

2)  t_pkey primary key (b, c, a)

Neither the PostgreSQL documentation nor Google have an answer - at least as far as I could find.  I see examples in the Postgres documentation that use 2) but no explanation of why that choice was made.  

Does it even make a difference?

Thoughts?

--
Rumpi Gravenstein

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

Предыдущее
От: Jerry LeVan
Дата:
Сообщение: Re: Psql wants to use IP6 when connecting to self using tcp...
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Partitioned Table Index Column Order