Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
1 / 5
0

postgres vacuum freezing

DEV Community·Database Man·19 days ago
#effrrGds
Reading 0:00
15s threshold

TLDR A frozen row is a row whose inserting transaction is so safely in the past that Postgres can treat it as visible to all future transactions. This helps vacuum avoid transaction ID wraparound issues. What does a frozen row mean in Postgres? If you’ve ever looked at the docs for vacuuming in Postgres, you may have seen the term “freezing rows”. If you are anything like me, that probably did not make sense at first. So I thought I would create a quick blog post explaining it and hopefully not get it too wrong. The basics Because Postgres uses MVCC, every time a row is modified it creates a new row version with the new data. The old row version has metadata fields that are used to keep track of which data is fresh (the data that should be seen by new queries) and which data is stale (the data that may still be seen by old queries). It uses XMIN and XMAX for this: XMIN is the transaction id that inserted the row, and XMAX is usually the transaction id that deleted, updated, or locked that row.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More