pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martín Fernández <fmartin91@gmail.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Behaviour when autovacuum is canceled
Date: Thu, 13 Sep 2018 16:14:41 -0700
Message-ID: <5b9aee4e3f8b8f4e0c000003@polymail.io> (raw)
In-Reply-To: <5b9aebc53f8b8f4e0c000002@polymail.io>
References: <5b9aebc53f8b8f4e0c000002@polymail.io>

David,

Your last comment applies for cleaning up indexes as well ? We performed a simple test in our production database to understand behaviour and we got a result that surprised us based on your last comment.

We basically started a VACUUM on a given table, waited for one index to process (captured cleaned rows count) and cancel the VACUUM. When we run another VACUUM on the same table the dead rows removed from the first index was a number slightly higher than the value logged on the first VACUUM. This behaviour made us feel that the work done to clean dead tuples on the first index was performed again. 

Thanks!

Martín

On Thu, Sep 13th, 2018 at 8:0 PM, "Martín Fernández" <fmartin91@gmail.com> wrote:

> 
> David,
> 
> 
> Thanks a lot for the quick reply. 
> 
> 
> I clearly misunderstood the references in the code. 
> 
> 
> Best,
> 
> Martín
> 
> 
> On Thu, Sep 13th, 2018 at 7:55 PM, "David G. Johnston" < david.g.johnston@gmail.com
> > wrote:
> 
> 
>> 
>> On Thu, Sep 13, 2018 at 3:45 PM, Martín Fernández < fmartin91@gmail.com > wrote:
>> 
>> 
>>> From what I could understand (that can be totally wrong), the vacuum
>>> process is split in multiple small transactions. If the autovacuum is
>>> canceled, could it be possible that only the latest transaction work be
>>> lost 
>>> 
>> 
>> 
>> 
>> From the docs:
>> 
>> 
>> "VACUUM cannot be executed inside a transaction block."
>> 
>> 
>> As it is non-transactional any work it performs is live immediately and
>> irrevocably as it occurs.
>> 
>> 
>> David J.
>> 
>> 
>> 
> 
> 
> 
>

view thread (8+ messages)  latest in thread

Message-ID: <5b9aee4e3f8b8f4e0c000003@polymail.io>
Permalink:  ../5b9aee4e3f8b8f4e0c000003@polymail.io/
Also on:    postgresql.org/message-id/5b9aee4e3f8b8f4e0c000003@polymail.io

 · 

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: fmartin91@gmail.com, david.g.johnston@gmail.com
  Subject: Re: Behaviour when autovacuum is canceled
  In-Reply-To: <5b9aee4e3f8b8f4e0c000003@polymail.io>
  References: <5b9aebc53f8b8f4e0c000002@polymail.io> <5b9aee4e3f8b8f4e0c000003@polymail.io>

* 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