RE: vacuum full doubled database size - Mailing list pgsql-general

From Kevin Brannen
Subject RE: vacuum full doubled database size
Date
Msg-id SA0PR19MB4255530425CA2B9D971F0427A4FA0@SA0PR19MB4255.namprd19.prod.outlook.com
Whole thread Raw
In response to Re: vacuum full doubled database size  (Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>)
List 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,
youare hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or
attachedto this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately
notifyus by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them
todisk. Thank you.
 

pgsql-general by date:

Previous
From: Fabio Ugo Venchiarutti
Date:
Subject: Re: vacuum full doubled database size
Next
From: Jerry Sievers
Date:
Subject: Re: pg_upgrade 9.6 to 12 without 9.6 binaries