public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: Gus Spier <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Attempting to delete excess rows from table with BATCH DELETE
Date: Tue, 27 Jan 2026 20:31:22 -0700
Message-ID: <CAKFQuwa96OCxiW5yLtnUVvN1U4208o9c3NvLxnL1MkojLhQcVg@mail.gmail.com> (raw)
In-Reply-To: <CAG8xnif_jmRYAGUvtoQNsHA8UqGRDkwuSffO55-3wGMLQArA8g@mail.gmail.com>
References: <CAG8xnif_jmRYAGUvtoQNsHA8UqGRDkwuSffO55-3wGMLQArA8g@mail.gmail.com>
On Tuesday, January 27, 2026, Gus Spier <[email protected]> wrote:
> Environment: AWS RDS Aurora for PostgreSQL 15 hosting tables that
> support scientific research. The development environment predominantly
> uses JPA with Hibernate.
>
> Years of neglect have allowed mission tables to accumulate hundreds of
> millions of rows of excess data. The developers and the customer
> decided we must delete all rows older than 75 days. Table partitioning
> was briefly considered but discarded because of the effort needed to
> refactor the codebase.
>
> I proposed the straight-forward course of action: delete by batches
> from the victim tables.
>
>
Strongly encourage you to try to accomplish your goal without any delete
commands at that scale that causes vacuuming. Can you just create an empty
copy and load the data to keep into it then point at the newly filled
database? Truncate is OK.
Daily trimming going forward would be less problematic at least.
David J.
view thread (3+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Attempting to delete excess rows from table with BATCH DELETE
In-Reply-To: <CAKFQuwa96OCxiW5yLtnUVvN1U4208o9c3NvLxnL1MkojLhQcVg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox