pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: John Lumby <johnlumby@hotmail.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Cc: Simon Riggs <simon@2ndquadrant.com>
Subject: Re: admin control over cancelling autovacuum when blocked by a lock
Date: Mon, 29 Apr 2019 21:44:22 -0400
Message-ID: <19835.1556588662@sss.pgh.pa.us> (raw)
In-Reply-To: <DM6PR06MB556216D6085FE0B9C267E82CA33A0@DM6PR06MB5562.namprd06.prod.outlook.com>
References: <DM6PR06MB556272F9CB7629B10CE86829A3390@DM6PR06MB5562.namprd06.prod.outlook.com>
	<CANP8+jJSysBHF_QRdYmT-iKQDy4yw8OaqgiLoNJPdjTX1bJB8w@mail.gmail.com>
	<DM6PR06MB556216D6085FE0B9C267E82CA33A0@DM6PR06MB5562.namprd06.prod.outlook.com>

John Lumby <johnlumby@hotmail.com> writes:
> On 04/29/2019 07:15 PM, Simon Riggs wrote:
>> Why would you want this?

> Because it greatly reduces rate of growth of certain indexes in some 
> workloads
> (based on test in which I modified the code to change the cancel to a 
> plain WARNING)

[ raised eyebrow... ]  Shouldn't do so, I think.  What exactly are you
doing that's causing the cancel?

> I *think* when an autovacuum worker is cancelled,  all or most of the work
> it did on its last table is undone  --  true?

If what's canceled is the final step of truncating off empty end pages
in the table, you shouldn't lose anything except the actual truncation.
And that's normally the only part that gets canceled, because it's the
only part that takes a strong lock.  If you're losing index cleanup
work, it suggests that you're repeatedly executing DDL that requires
exclusive lock on the table.  Maybe you could avoid doing that?

			regards, tom lane





view thread (15+ messages)  latest in thread

Message-ID: <19835.1556588662@sss.pgh.pa.us>
Permalink:  ../19835.1556588662@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/19835.1556588662@sss.pgh.pa.us

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, johnlumby@hotmail.com, simon@2ndquadrant.com
  Subject: Re: admin control over cancelling autovacuum when blocked by a lock
  In-Reply-To: <19835.1556588662@sss.pgh.pa.us>

* 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