In Part 2, the TAM callbacks needed for CREATE TABLE … USING memtable were wired up, but there is not yet any storage, so there is no point in making INSERT, DELETE, UPDATE, and SELECT work. pg_memtable stores table data in shared memory, so before writing a single line of pg_memtable-specific code, it’s worth covering …
Continue reading Building a Table Access Method, Part 3: shared memory in Postgres
Month:September 2026
Building a Table Access Method, Part 2
In Part 1 the difference between table access methods and foreign data wrappers was covered. This post starts implementing one. This post starts by looking at what you actually want to get out of an in-memory table, drawing on research into why memory-resident engines are fast, then starts writing a table access method (TAM) named …
Continue reading Building a Table Access Method, Part 2
Building a Table Access Method, Part 1
The standard storage engine of Postgres is called the “heap” because of the storage method. The data is stored in “heap files” in no particular order, just added wherever there’s room and extending the file at the end only when there are no space inside the pages of the file. This storage engine is simple …
Continue reading Building a Table Access Method, Part 1
