A backend keeps its mapping of the arena in its cache. As a result, if another backend drops or truncates the table, the memory of the old arena is not returned until that backend disconnects, so the cache has to be invalidated when the relation changes. This post uses the relcache invalidation messages of Postgres …
Continue reading Building a Table Access Method, Part 8: Cache invalidation
Month:November 2026
Building a Table Access Method, Part 7: Storing and reading rows
Every memtable table now has an arena with a proper lifecycle, but nothing is stored in it. This post stores rows in the arena and reads them back with a full table scan. Along the way it shows what tuple format to use for efficiency, how any backend finds the arena of a table, how …
Continue reading Building a Table Access Method, Part 7: Storing and reading rows
