Vacuuming: To Freeze or Not To Freeze?

From: Don Seiler <don(at)seiler(dot)us>
To: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Vacuuming: To Freeze or Not To Freeze?
Date: 2017-08-22 21:26:39
Message-ID: CAHJZqBBVSRoUpBs-8YHfwPSDmLafrWJMELtqLSjWQ2quE0TNxA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Pg 9.2.18.

I discovered a large table that has no last_autovacuum date in
pg_stat_all_tables. Manual attempts to vacuum it in a new clone show that
it is because there are 3 bad indexes. Once I recreate those indexes
(create followed by drop and rename for concurrency), my plan was to run a
manual VACUUM ANALYZE. I'm also wondering if I should include FREEZE in
there.

To paint you a picture:

- pg_stat_all_tables shows this table having 35M lives rows and over 80M
dead rows.
- There is almost always an autovacuum session running for this table to
prevent wraparound. It will always bomb out when it gets to the indexes.
- This table shows a last_autoanalyze date from Nov 2016, and no
last_autovacuum or vacuum date.
- My plan was to disable autovacuum on this table at the start of my
script to prevent the autovacuum from blocking index drops. However this
obviously won't stop the wraparound prevention autovacuum runs. Any way to
get around this? In my clone I baby sat it and killed the autovac process
each time to let my script complete. I'm hoping to not have to babysit this
too closely on Saturday but if I do then I do. C'est la vie.

I'm just beginning to get into the XID & freezing part of my journey but it
sounds like it might be a good option while I'm doing this maintenance. The
plan is for Saturday when it is relatively quiet, however the DB definitely
still needs to be available for normal work.

Don.

--
Don Seiler
www.seiler.us

Browse pgsql-admin by date

  From Date Subject
Next Message Michael Paquier 2017-08-23 00:55:07 Re: Fwd: PostgreSQL 9.4.13 is facing issue in shutting down
Previous Message Peter Eisentraut 2017-08-22 19:16:48 Re: PostgreSQL 9.4.13 is facing issue in shutting down