| From: | Ron Johnson <ronljohnsonjr(at)gmail(dot)com> |
|---|---|
| To: | "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: Question on PostgreSQL Table Partitioning – Performance of Queries That Do Not Use the Partition Key |
| Date: | 2025-11-26 14:16:23 |
| Message-ID: | CANzqJaDC4NbGbMBmHXJKTc7HW4HYDy+Hu+_mR72wYeMN5YL=Eg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Wed, Nov 26, 2025 at 8:32 AM atma ram <atmaramkp(at)gmail(dot)com> wrote:
> Hi,
>
> Question on PostgreSQL Table Partitioning – Performance of Queries That Do
> Not Use the Partition Key
>
> We have a table that is approximately 1.6 GB in size. Query performance
> has started to degrade. Although we have multiple indexes, the large table
> size
>
1.6GB is pretty darned tiny. Did you mean TB?
When was the last time the table was vacuumed and analyzed? Tuning
autovacuum parameters is important, but you might have to also create a
cron job to regularly manually analyze and vacuum them.
is still causing performance issues.
>
> We are planning to partition the table on the primary key. This is an OLTP
> system, and there are around 100 queries that access this table. About 80
> of these queries use the primary key and will therefore benefit directly
> from the partition key once we implement partitioning. However, the
> remaining 20 queries do not use the primary key; they rely on other indexed
> columns.
>
> Our question is: after partitioning the table, and after creating the
> necessary indexes on each partition, what happens to the performance of
> those 20 queries that do *not* use the partition key?
> – Will their performance degrade?
> – Will it remain the same as before partitioning?
> – Is there any chance it will improve?
>
> Additional details: we plan to create only 16 partitions, so the partition
> count will not be very high.
>
> *Is there any benchmarking, documentation, or reference material that can
> help demonstrate how partitioning will affect the performance of the 20
> queries that do not use the partition key?*
>
> This information is critical for us before proceeding with the
> partitioning strategy.
>
Every circumstance is different. You're going to have to test it.
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Vincent Veyron | 2025-11-26 14:48:44 | Re: Selecting all variations of job title in a list |
| Previous Message | atma ram | 2025-11-26 13:20:41 | Question on PostgreSQL Table Partitioning – Performance of Queries That Do Not Use the Partition Key |