Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g0ap6-0001ig-AW for pgsql-general@arkaria.postgresql.org; Thu, 13 Sep 2018 23:14:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g0ap4-0005eK-Uw for pgsql-general@arkaria.postgresql.org; Thu, 13 Sep 2018 23:14:54 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g0ap4-0005eD-HX for pgsql-general@lists.postgresql.org; Thu, 13 Sep 2018 23:14:54 +0000 Received: from mail-it0-x244.google.com ([2607:f8b0:4001:c0b::244]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g0ap2-00089d-4V for pgsql-general@lists.postgresql.org; Thu, 13 Sep 2018 23:14:53 +0000 Received: by mail-it0-x244.google.com with SMTP id h3-v6so259333ita.2 for ; Thu, 13 Sep 2018 16:14:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:date:from:to:cc:in-reply-to:references:message-id :subject; bh=or0H86hy9YdGedO/p8BrATTMqSbRasHPEpiZ2zhxCb8=; b=A/UKChPsliQB2OHdoZtMKIRvt3nnsc2u4+GJ6evvtL3xltPYQZclBNvlJh1cH2/06n 4VIdCMMKjj7kE1Ew7u5SiIIfaXrb0RdQjawQldBge4RjeZCHZrMX1cemXXHl6o9O99L3 Xs7IvH37mrlopTL+vIi7mtGsj68p4n3yw5v2sIMc3HOqgf6t8G7rLzTUXldz4NKkhhPB up7cJfs7z+n9nWKdtfboBjh44/Z7Tafpb43LSYqnBqR8pnV3y/Cjrwv8f2lanwg8mcwu vfW8Gt6Hev6zNOmKEVyk5OkdiKFWdPJRoQZJsbNy7eXT4bumK5iOVEwgbEzNJARW03Su /Suw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:date:from:to:cc:in-reply-to :references:message-id:subject; bh=or0H86hy9YdGedO/p8BrATTMqSbRasHPEpiZ2zhxCb8=; b=ZGyF+JYfEANmiZGEFKzy/Ni77KAggMc2aKsMttLdJ54KHZN9sDDCU/qvWu2xd8AESQ 24m82fFLYoaC91iXL9yS97iewG8lKJEFlVeZg6IPdJzQmJ06yOG4d1RJBXAmVAgmtc7S AXHEmmgmgEUrQk6y20AoRvcNirpup4qY7MeTCdeSM3sZzHracqYnnTDmaDjA0/O08Ay1 mOajKVEZlNMdlCYZtbiiJthqLxXArEtMFKJtGF5FN+S5HdFuP/6XI0aKsEENO469TSjb rWF47L326cI+MF565lVlA6FvV1ha/mNmSw/WMjmWozMMu2cLTJc69GTUlyIShNgBKaBN PsPg== X-Gm-Message-State: APzg51AsyhZE/gMs3lI/1IBD0GuDCYoNr03yYEqs54AkvU1Xd0p1JBhO HoNxB4qfVaGxTHXuLFNYPvrv558S X-Google-Smtp-Source: ANB0VdYmq/Ris3wB1Vmk0HN8dx0LzR0/p/eouXo8GM+Df6AFX5ggBG7I9yOI2nzAld+HlspUWOEIIg== X-Received: by 2002:a02:4d1b:: with SMTP id l27-v6mr8906802jab.86.1536880490916; Thu, 13 Sep 2018 16:14:50 -0700 (PDT) Received: from localhost (182.143.225.35.bc.googleusercontent.com. [35.225.143.182]) by smtp.gmail.com with ESMTPSA id a11-v6sm27279ita.21.2018.09.13.16.14.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Sep 2018 16:14:50 -0700 (PDT) Mime-Version: 1.0 X-Mailer: Polymail Date: Thu, 13 Sep 2018 16:14:41 -0700 From: =?UTF-8?q?Mart=C3=ADn_Fern=C3=A1ndez?= To: "David G. Johnston" Cc: "pgsql-generallists.postgresql.org" In-Reply-To: <5b9aebc53f8b8f4e0c000002@polymail.io> References: <5b9aebc53f8b8f4e0c000002@polymail.io> Message-ID: <5b9aee4e3f8b8f4e0c000003@polymail.io> Subject: Re: Behaviour when autovacuum is canceled Content-Type: multipart/alternative; boundary=35948e10bfa8de50d2c7110d860761645b1d9bbc3846717c7f6e239c3d02 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --35948e10bfa8de50d2c7110d860761645b1d9bbc3846717c7f6e239c3d02 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 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 pro= cess (captured cleaned rows count) and cancel the VACUUM. When we run anoth= er 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 be= haviour made us feel that the work done to clean dead tuples on the first i= ndex was performed again.=C2=A0 Thanks! Mart=C3=ADn On Thu, Sep 13th, 2018 at 8:0 PM, "Mart=C3=ADn Fern=C3=A1ndez" wrote: >=20 > David, >=20 >=20 > Thanks a lot for the quick reply.=C2=A0 >=20 >=20 > I clearly misunderstood the references in the code.=C2=A0 >=20 >=20 > Best, >=20 > Mart=C3=ADn >=20 >=20 > On Thu, Sep 13th, 2018 at 7:55 PM, "David G. Johnston" < david.g.johnston= @gmail.com > > wrote: >=20 >=20 >>=20 >> On Thu, Sep 13, 2018 at 3:45 PM, Mart=C3=ADn Fern=C3=A1ndez < fmartin91@= gmail.com > wrote: >>=20 >>=20 >>> 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=C2=A0 >>>=20 >>=20 >>=20 >>=20 >> From the docs: >>=20 >>=20 >> "VACUUM cannot be executed inside a transaction block." >>=20 >>=20 >> As it is non-transactional any work it performs is live immediately and >> irrevocably as it occurs. >>=20 >>=20 >> David J. >>=20 >>=20 >>=20 >=20 >=20 >=20 > --35948e10bfa8de50d2c7110d860761645b1d9bbc3846717c7f6e239c3d02 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8 3D""
David,=

Your last comment applies f= or cleaning up indexes as well ? We performed a simple test in our producti= on database to understand behaviour and we got a result that surprised us b= ased on your last comment.

W= e basically started a VACUUM on a given table, waited for one index to proc= ess (captured cleaned rows count) and cancel the VACUUM. When we run anothe= r 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 beh= aviour made us feel that the work done to clean dead tuples on the first in= dex was performed again. 

Thanks!

Mart=C3=ADn
<= /div>

On Thu, Sep 13th, 2018 at 8:0 PM, "Mart=C3=ADn Fern=C3=A1ndez" &= lt;fmartin91@gmail.com> wrote:
<= div>
David,

Thank= s a lot for the quick reply. 

I clearly misunderstood the references in the code. 

Best,
Mart=C3=ADn
On Thu, Sep 13th, 2018 at 7:55 PM, "Davi= d G. Johnston" <david.g.j= ohnston@gmail.com> wrote:
On Thu, Sep 13, 2018 at 3:45 PM, Mart=C3=ADn Fern=C3=A1ndez <fmartin91@gmail.com> wrote:
From wh= at I could understand (that can be totally wrong), the vacuum process is sp= lit in multiple small transactions. If the autovacuum is canceled, could it= be possible that only the latest transaction work be lost 

From the docs:
<= div class=3D"p8sswihky43gx-pto6it6rmy2ge-gmail_default" style=3D"font-famil= y:arial,helvetica,sans-serif">
"VAC= UUM cannot be executed inside a transaction block."

As it is non-transact= ional any work it performs is live immediately and irrevocably as it occurs= .

David J.



--35948e10bfa8de50d2c7110d860761645b1d9bbc3846717c7f6e239c3d02--