RE: vacuum full doubled database size

From: Kevin Brannen <KBrannen(at)efji(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: vacuum full doubled database size
Date: 2020-03-13 16:01:32
Message-ID: SA0PR19MB4255530425CA2B9D971F0427A4FA0@SA0PR19MB4255.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

>Fabio Ugo Venchiarutti wrote:
>On 13/03/2020 15:15, Ron wrote:
>> This is why I'd VACUUM FULL in a planned manner, one or two tables at
>> a time, and *locally* from crontab.
>
>That's not really viable on any remotely busy system: VACUUM FULL claims exclusive table locks, causing queries to hang (https://www.postgresql.org/docs/current/sql-vacuum.html#NOTES mentions this too).
>
>Tools like pg_repack can do some live shrinking.

To say "not really viable on any remotely busy system" is a pretty sweeping
statement. I think a better statement is that "for many busy systems, this could
be a real problem and to consider it carefully in light of your needs."

On our systems, we do this just fine, though the difference is probably the
level of busy. We have periods that are not as busy as others (1am). In addition,
most of our tables are fairly small'ish and a VACUUM FULL takes 30sec or
less, so it's not so bad. The vast majority of our data is in about a dozen
tables which are mostly used for reports by people in the daytime, so if they
lock for 5min each in the middle of the night on a weekend it's OK (and we only
do this once a quarter).

So this approach can work, but "it depends" and "YMMV" and all that jazz...which
I believe was what Ron was trying to point out with planning.

That being said, I've had "go check out pg_repack" on my to-do list for a while and
one day I will, but at the moment the above works for us.

Kevin

.
This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jerry Sievers 2020-03-13 16:25:50 Re: pg_upgrade 9.6 to 12 without 9.6 binaries
Previous Message Fabio Ugo Venchiarutti 2020-03-13 15:32:29 Re: vacuum full doubled database size