Re: Table Partitioning and Indexes Performance Questions

2024-02-29 Thread Anupam b
ysg> From: Laurenz Albe Sent: Thursday, February 29, 2024 9:32:48 AM To: David Kelly ; pgsql-performance@lists.postgresql.org Subject: Re: Table Partitioning and Indexes Performance Questions On Thu, 2024-02-29 at 11:42 -0500, David Kelly wrote: > I was

Re: Table Partitioning and Indexes Performance Questions

2024-02-29 Thread Laurenz Albe
On Thu, 2024-02-29 at 11:42 -0500, David Kelly wrote: > I was told that partitioned table indexed must always start with the > partition key columns. That's not true. Only unique indexes (as used by primary key and unique constraints) must contain the partitioning key (but they don't have to sta

Table Partitioning and Indexes Performance Questions

2024-02-29 Thread David Kelly
I was told that partitioned table indexed must always start with the partition key columns. Is this always the case or does it depend on use case? When would you want to create indexes in this way? The documentation just mentions that it is strictly unnecessary but can be helpful. My understandin