pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wetmore, Matthew (CTR) <Matthew.Wetmore@evernorth.com>
To: srinivasan s <srinioracledba7@gmail.com>
To: pgsql-admin@lists.postgresql.org <pgsql-admin@lists.postgresql.org>
Subject: Need guidance on partioning
Date: Wed, 22 May 2024 13:39:55 +0000
Message-ID: <58ba1eea470d440faea4100910529787@evernorth.com> (raw)
In-Reply-To: <CAOEeMcVA7VQv2F7MeLHkxy30BY=7b=fgu3hvYg=7D13iMLuYVQ@mail.gmail.com>
References: <CAOEeMcVA7VQv2F7MeLHkxy30BY=7b=fgu3hvYg=7D13iMLuYVQ@mail.gmail.com>

Define large.

IMO, I don’t partition until 750M to 1B rows.

Maybe 500M is the table is heavily used or very wide.

Partitioning under those row counts without working knowledge can hinder performance.

From: srinivasan s <srinioracledba7@gmail.com>
Sent: Wednesday, May 22, 2024 5:04 AM
To: pgsql-admin@lists.postgresql.org
Subject: [EXTERNAL] Need guidance on partioning

Hello everyone,

I hope you are all doing well.

I am seeking guidance on how to implement partitioning in PostgreSQL.

We have a large table that currently does not have any partitioning, and we have two requirements for removing old data from this table. We are looking to create a new table with partitioning.

1. The first requirement is to delete all records from the table that are older than 18 months. I believe we can achieve this by using range partitioning on the timestamp column.

2. The second requirement is to remove data from the table when a user leaves the organization. We have the account ID and user ID in the same table.

Could someone please offer guidance on selecting the appropriate partitioning method (range, sub-partition, or composite)?

Additionally, not all queries use the timestamp column in the WHERE condition. Is it mandatory to use the partition key in the WHERE condition to benefit from partitioning? Can we create a composite index that combines the partition key column with other columns used in the WHERE clause? Would this be beneficial?

Thank you.






view thread (10+ messages)  latest in thread

Message-ID: <58ba1eea470d440faea4100910529787@evernorth.com>
Permalink:  ../58ba1eea470d440faea4100910529787@evernorth.com/
Also on:    postgresql.org/message-id/58ba1eea470d440faea4100910529787@evernorth.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: Matthew.Wetmore@evernorth.com, srinioracledba7@gmail.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Need guidance on partioning
  In-Reply-To: <58ba1eea470d440faea4100910529787@evernorth.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox