Re: Purging few months old data and vacuuming in production
| От | Ron |
|---|---|
| Тема | Re: Purging few months old data and vacuuming in production |
| Дата | |
| Msg-id | a4199207-a5dc-583a-5782-67e1ab8f57c8@gmail.com обсуждение исходный текст |
| Ответ на | Re: Purging few months old data and vacuuming in production ("Peter J. Holzer" <hjp-pgsql@hjp.at>) |
| Ответы |
Re: Purging few months old data and vacuuming in production
|
| Список | pgsql-general |
On 1/7/23 05:29, Peter J. Holzer wrote:
[snip]
300 records/second. Fewer DELETE statements if there are one-many relationships with the child tables.
[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.
Born in Arizona, moved to Babylonia.
В списке pgsql-general по дате отправления: