pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Can long-running VACUUM be interrupted?
2+ messages / 2 participants
[nested] [flat]

* Can long-running VACUUM be interrupted?
@ 2018-11-20 03:58 Andrey Zhidenkov <andrey.zhidenkov@gmail.com>
  2018-11-20 08:05 ` Re: Can long-running VACUUM be interrupted? Adrien NAYRAT <adrien.nayrat@anayrat.info>
  0 siblings, 1 reply; 2+ messages in thread

From: Andrey Zhidenkov @ 2018-11-20 03:58 UTC (permalink / raw)
  To: pgsql-admin

I have long-running prevent wraparound VACUUM (it has been running for
6 days at the moment). The question is: if I interrupt this process in
some way (restart database, for instance), will it start from the
beginning? On the one hand, it opens a new transaction at the
beginning (according to the source code), on the other hand it updates
some data on the disk (WAL?). It confuses me. Could someone please
explain me this?
-
With best regards, Andrey Zhidenkov




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Can long-running VACUUM be interrupted?
  2018-11-20 03:58 Can long-running VACUUM be interrupted? Andrey Zhidenkov <andrey.zhidenkov@gmail.com>
@ 2018-11-20 08:05 ` Adrien NAYRAT <adrien.nayrat@anayrat.info>
  0 siblings, 0 replies; 2+ messages in thread

From: Adrien NAYRAT @ 2018-11-20 08:05 UTC (permalink / raw)
  To: Andrey Zhidenkov <andrey.zhidenkov@gmail.com>; pgsql-admin

On 11/20/18 4:58 AM, Andrey Zhidenkov wrote:
> I have long-running prevent wraparound VACUUM (it has been running for
> 6 days at the moment). The question is: if I interrupt this process in
> some way (restart database, for instance), will it start from the
> beginning? On the one hand, it opens a new transaction at the
> beginning (according to the source code), on the other hand it updates
> some data on the disk (WAL?). It confuses me. Could someone please
> explain me this?
> -
> With best regards, Andrey Zhidenkov
> 

Hi Andrez,

You could interrupt with pg_cancel_backend function, but autovacuum will 
restart after autovacuum_naptime delay (1min by default).

If you are 9.6+, Postgres will be able to skip already frozen row on the 
table, but it will scan all indexes from the beginning.

Why do you want to interrupt? This kind of vacuum is necessary to avoid 
wraparound: 
https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-WRAPAROUND


Regards,




^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2018-11-20 08:05 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20 03:58 Can long-running VACUUM be interrupted? Andrey Zhidenkov <andrey.zhidenkov@gmail.com>
2018-11-20 08:05 ` Adrien NAYRAT <adrien.nayrat@anayrat.info>

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