1

Platform Heroku PG version 13

I have a very busy database and it is reaching near transaction wrap around.

At this point I really want to do the vacuum manually. My question is that if I do manual vacuuming of individual tables then I can see that the txid restores to its minimum value. But the global txid is not changed.

Is the individual vacuuming of tables enough ? Do I still have to do vacuum database ?

hassan_i
  • 301
  • 2
  • 8
  • You have to vacuum the entire database. If you have enough IO, you could vacuum multiple tables concurrently. Don't wait, get started asap before the database shuts down – Frank Heikens Dec 08 '21 at 11:01
  • 2
    https://blog.crunchydata.com/blog/managing-transaction-id-wraparound-in-postgresql – Frank Heikens Dec 08 '21 at 11:10

1 Answers1

1

Yes, a manual VACUUM of individual tables will do the trick.

Look at the relfrozenxid and relminmxid columns in the pg_class entries for that database. Find the oldest ones. One or more of these should be equal to datfrozenxid and datminmxid in pg_database. If you VACUUM those tables, the values for the database should advance.

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263