Re: Table Partitioning and Indexes Performance Questions

From: Anupam b <abordia99(at)hotmail(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, David Kelly <dkelly123190(at)gmail(dot)com>, "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Table Partitioning and Indexes Performance Questions
Date: 2024-02-29 18:11:33
Message-ID: DM4PR20MB5725047D2AB72E3196A8AE90BD5F2@DM4PR20MB5725.namprd20.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Would eliminating triggers and stored procedure would be step #1 to start seeing gains from partitions?
We have many triigers and stored procedure and i am trying to to kake sure if need to deprecate before moving to partitioning.

Many thx
Andy

Get Outlook for Android<https://aka.ms/AAb9ysg>
________________________________
From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Sent: Thursday, February 29, 2024 9:32:48 AM
To: David Kelly <dkelly123190(at)gmail(dot)com>; pgsql-performance(at)lists(dot)postgresql(dot)org <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Table Partitioning and Indexes Performance Questions

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 start with it).

> Any other performance considerations when it comes to partitioned table indexing?
> Specifically, partitioning by range where the range is a single value.

Not particularly - selecting from a partitioned table is like selecting
from a UNION ALL of all partitions, except that sometimes PostgreSQL
can forgo scanning some of the partitions.
If you use very many partitions, the overhead for query planning and
execution can become noticable.

Yours,
Laurenz Albe

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Chema 2024-02-29 23:15:42 Re: Optimizing count(), but Explain estimates wildly off
Previous Message Laurenz Albe 2024-02-29 17:32:48 Re: Table Partitioning and Indexes Performance Questions