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  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список 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 по дате отправления:

Предыдущее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Purging few months old data and vacuuming in production
Следующее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Purging few months old data and vacuuming in production