Re: Purging few months old data and vacuuming in production - Mailing list pgsql-general

From Ron
Subject Re: Purging few months old data and vacuuming in production
Date
Msg-id a4199207-a5dc-583a-5782-67e1ab8f57c8@gmail.com
Whole thread Raw
In response to Re: Purging few months old data and vacuuming in production  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Responses Re: Purging few months old data and vacuuming in production
List pgsql-general
On 1/7/23 05:29, Peter J. Holzer wrote:
[snip]
If I understood correctly, you have to delete about 3 million records
(worst case) from the main table each day. Including the other 8 tables
those are 27 million DELETE queries each of which deletes only a few
records. That's about 300 queries per second. I'd be worried about
impacting performance on other queries at this rate.

300 records/second.  Fewer DELETE statements if there are one-many relationships with the child tables.

I'd go for a middle ground: Instead of expiring once per day, use a
shorter interval, maybe once per hour or once per minute. That will
(probably) make each expire job really quick but still create much less
load overall.

--
Born in Arizona, moved to Babylonia.

pgsql-general by date:

Previous
From: "Peter J. Holzer"
Date:
Subject: Re: Purging few months old data and vacuuming in production
Next
From: "Peter J. Holzer"
Date:
Subject: Re: Purging few months old data and vacuuming in production