TOAST: How PostgreSQL Stores Wide Column Values Out of Line
A row must fit inside an 8 KB page, so when a value is too big, PostgreSQL compresses it and, if that is not enough, moves it into a side table called TOAST and leaves a pointer behind. The good news is that scans over the main table skip those big values entirely unless you ask for them; the bad news is that selecting a large text or JSON column costs extra reads in the side table per row. It is a direct argument for naming the columns you need rather than selecting everything from a table that stores documents.
Questions this Concept answers
Why can a scan over a table with huge JSON columns be fast when you do not select those columns?
J
jeremy
Video
Why Operations on Large Text Columns Are Slow in PostgreSQL Because of TOAST Storage
PostgreSQL stores tuples inside fixed-size pages (8 kB by default) and a tuple may not span pages, so any value too large to fit is moved out of line by TOAST (The Oversized-Attribute Storage Techniq…