AdvancedAdvanced PostgreSQL

Theory: What is TOAST?

The query

SQL
-- Q: What is TOAST in PostgreSQL?
-- A: The Oversized-Attribute Storage Technique.
-- PostgreSQL uses a fixed page size (usually 8kB). If a row exceeds this 
-- (like storing a massive JSON payload or long text), PostgreSQL automatically 
-- compresses and splits the large data into multiple physical rows in a 
-- hidden TOAST table, storing only a pointer in the main table.
Tested against PostgreSQL 16

Note

TOAST happens completely transparently to the user.