ads' corner

PostgreSQL Berlin July 2024 Meetup

On July 16th, 2024, we had the PostgreSQL July Meetup in Berlin. Adjust hosted and Neon sponsored the Meetup in their Berlin Headquarter at Prenzlauer Berg, near the TV Tower.

Understanding VACUUM, VACUUM template0, and Transaction ID Wraparound

PostgreSQL uses Multi-Version Concurrency Control (MVCC) to manage concurrent access to the database, and store each version of a tuple in a table. To keep the database efficient, PostgreSQL employs a cleanup process called VACUUM, which removes unnecessary tuples. This not only saves disk space and keeps the database size under control, it also prevents the dreaded 'Transaction ID Wraparound' issue. Regularly running VACUUM is crucial, including on the template0 database, which is normally handled by the Autovacuum daemon. However, sometimes manual intervention is necessary.

ctid and other PostgreSQL table internals

While attending a conference (yay) the discussion turned to system columns, and especially 'ctid'. This was in context of backups, and the physical position of data on disk. The question was if that can be used to determine if an incremental backup is required, and if it is enough to just copy that field where the 'ctid' points to. Not quite, but I’d like to use this question to describe the system columns more in detail.