Search Postgresql Archives

Partitioned Table Index Column Order

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux