Re: [EXT] Re: Does cancelling autovacuum make you lose all the work it did?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Greg Rychlewski (LCL)" <Greg(dot)Rychlewski(at)loblaw(dot)ca>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, Stephen Froehlich <s(dot)froehlich(at)cablelabs(dot)com>, "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: [EXT] Re: Does cancelling autovacuum make you lose all the work it did?
Date: 2020-06-13 03:18:28
Message-ID: 798972.1592018308@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

"Greg Rychlewski (LCL)" <Greg(dot)Rychlewski(at)loblaw(dot)ca> writes:
> Thanks for your reply. Regarding it being blocked, I don't think it is but I could be wrong. Both wait_event and wait_event_type are null. One thing I noticed though is that n_dead_tup in pg_stat_all_tables either stays the same or goes up. Should this be going down during the autovacuum?

No ... ongoing transactions could be creating new dead rows. IIRC,
a vacuum won't report its removal of dead rows to the stats collector
till the very end, so what I'd expect is a big drop when it finishes.

(I am not sure offhand what happens to those stats if you cancel the
vacuum partway through --- it might report nothing, causing the
stats to be way off until the next successful vacuum.)

regards, tom lane

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Manojkumar S 2020-06-15 11:05:11 ".partial" WAL file missing while promoting database in streaming replication.
Previous Message Greg Rychlewski (LCL) 2020-06-13 00:32:14 Re: [EXT] Re: Does cancelling autovacuum make you lose all the work it did?