pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter J. Holzer <hjp-pgsql@hjp.at>
To: pgsql-general@lists.postgresql.org
Subject: Re: Recommendation to run vacuum FULL in parallel
Date: Wed, 3 Apr 2019 16:57:58 +0200
Message-ID: <20190403145758.5f7tquc55oblwhsx@hjp.at> (raw)
In-Reply-To: <22db5af2-5593-ef4c-485a-83f3495c48c3@mail.ru>
References: <9ed59ae2-6eb1-549d-eb05-d1546fd11515@mail.ru>
	<CAHOFxGqzLdRc+0dNp9q6q2oBCYUiQCmzYm8ma3Cng5m1+1tnZQ@mail.gmail.com>
	<22db5af2-5593-ef4c-485a-83f3495c48c3@mail.ru>

On 2019-04-03 18:49:02 +0400, rihad wrote:
> On 04/03/2019 06:40 PM, Michael Lewis wrote:
> > "Sometimes a table's usage pattern involves much more updates than
> > inserts, which gradually uses more and more unused space that is never
> > used again by postgres, and plain autovacuuming doesn't return it to the
> > OS."
> > 
> > Can you expound on that? I thought that was exactly what autovacuum did
> > for old versions of rows whether dead because of delete or update, so I
> > am surprised by this statement. I thought vacuum full was only ever
> > needed if storage space is an issue and the table is not expect to
> > quickly re-expand to current size on disk from new churn of tuples.
> 
> 
> From what I understand from the docs updates keep older versions of rows
> intact because other transactions might still use them (this is the essence
> of MVCC), and autovacuuming (plain VACUUM) marks that space as available
> when it is run, so future inserts can reuse it.

And future updates can reuse it, too (an update is very similar to an
insert+delete).

> In case the number of updates is much greater than the number of
> inserts, the unused zombie space gradually creeps up.

Not if autovacuum has a chance to run between updates.

        hp

-- 
   _  | Peter J. Holzer    | we build much bigger, better disasters now
|_|_) |                    | because we have much more sophisticated
| |   | hjp@hjp.at         | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson <https://www.edge.org/;

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (17+ messages)  latest in thread

Message-ID: <20190403145758.5f7tquc55oblwhsx@hjp.at>
Permalink:  ../20190403145758.5f7tquc55oblwhsx@hjp.at/
Also on:    postgresql.org/message-id/20190403145758.5f7tquc55oblwhsx@hjp.at

 · 

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: hjp-pgsql@hjp.at
  Subject: Re: Recommendation to run vacuum FULL in parallel
  In-Reply-To: <20190403145758.5f7tquc55oblwhsx@hjp.at>
  References: <9ed59ae2-6eb1-549d-eb05-d1546fd11515@mail.ru> <CAHOFxGqzLdRc+0dNp9q6q2oBCYUiQCmzYm8ma3Cng5m1+1tnZQ@mail.gmail.com> <22db5af2-5593-ef4c-485a-83f3495c48c3@mail.ru> <20190403145758.5f7tquc55oblwhsx@hjp.at>

* 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