pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fabio Ugo Venchiarutti <f.venchiarutti@ocado.com>
To: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: vacuum full doubled database size
Date: Fri, 13 Mar 2020 15:32:29 +0000
Message-ID: <e0e4f4c2-ff08-e410-8ffb-10dd51801c0f@ocado.com> (raw)
In-Reply-To: <caeb0759-20cc-30db-780d-b253f0ad66f0@gmail.com>
References: <87ee68cc208c4775bd422277291fbcaf@zuerich.ch>
	<caeb0759-20cc-30db-780d-b253f0ad66f0@gmail.com>

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.

I've also had some success at reclaiming space without large scale locks 
by carefully crafting some atomic DELETE + INSERT in order to force 
tuples from the tail end into gaps at lower CTIDs (physical page 
address) that were made available by previous plain VACUUMs - regular 
VACUUM will clip data files if all the tuples beyond a given offset are 
dead.



> 
> On 3/13/20 8:41 AM, Zwettler Markus (OIZ) wrote:
>>
>> We did a "vacuum full" on a database which had been interrupted by a 
>> network outage.
>>
>> We found the database size doubled afterwards.
>>
>> Autovacuum also found a lot of orphaned tables afterwards.
>>
>> The ophan temp objects went away after a cluster restart while the db 
>> size remained doubled.
>>
>> Any idea?
>>
>> Postgres 9.6.17
>>
> 
> -- 
> Angular momentum makes the world go 'round.

-- 
Regards

Fabio Ugo Venchiarutti
OSPCFC Network Engineering Dpt.
Ocado Technology

-- 


Notice: 
This email is confidential and may contain copyright material of 
members of the Ocado Group. Opinions and views expressed in this message 
may not necessarily reflect the opinions and views of the members of the 
Ocado Group.

If you are not the intended recipient, please notify us 
immediately and delete all copies of this message. Please note that it is 
your responsibility to scan this message for viruses.

References to the 
"Ocado Group" are to Ocado Group plc (registered in England and Wales with 
number 7098618) and its subsidiary undertakings (as that expression is 
defined in the Companies Act 2006) from time to time. The registered office 
of Ocado Group plc is Buildings One & Two, Trident Place, Mosquito Way, 
Hatfield, Hertfordshire, AL10 9UL.





view thread (6+ messages)  latest in thread

Message-ID: <e0e4f4c2-ff08-e410-8ffb-10dd51801c0f@ocado.com>
Permalink:  ../e0e4f4c2-ff08-e410-8ffb-10dd51801c0f@ocado.com/
Also on:    postgresql.org/message-id/e0e4f4c2-ff08-e410-8ffb-10dd51801c0f@ocado.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: f.venchiarutti@ocado.com, ronljohnsonjr@gmail.com
  Subject: Re: vacuum full doubled database size
  In-Reply-To: <e0e4f4c2-ff08-e410-8ffb-10dd51801c0f@ocado.com>
  References: <87ee68cc208c4775bd422277291fbcaf@zuerich.ch> <caeb0759-20cc-30db-780d-b253f0ad66f0@gmail.com> <e0e4f4c2-ff08-e410-8ffb-10dd51801c0f@ocado.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox