Обсуждение: [ADMIN] Vacuuming: To Freeze or Not To Freeze?

Поиск
Список
Период
Сортировка

[ADMIN] Vacuuming: To Freeze or Not To Freeze?

От
Don Seiler
Дата:
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