Postgres VACUUM and Xmin Horizon
I had a chance to learn about the concept called the “xmin horizon” in Postgres, so I’m leaving a learning memo. The xmin horizon is also called the oldest xmin, and it tells you “until which point (in terms of transactions) the vacuum process can clean up dead rows”. In other words, VACUUM can’t clean up dead rows after this xmin horizon. When you see a log like “1165 are dead but not yet removable”, it means that there were 1165 dead rows, but VACUUM wasn’t able to clean them up because they are after the xmin horizon.…