>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.

Reply via email to