12.2.15

TOAST: The Oversize-Attribute Storage Technique of PostgreSQL


PostgreSQL uses a fixed page size (commonly 8 kB), and does not allow tuples to span multiple pages. Therefore, it is not possible to store very large field values directly. To overcome this limitation, large field values are compressed and/or broken up into multiple physical rows. This happens transparently to the user, with only small impact on most of the backend code. The technique is affectionately known as TOAST (or "the best thing since sliced bread").
If the storage is main or extended, it means the data in given column is compressed (PostgreSQL uses very fast compression algorithm from the LZ family).
Answer from: Timur Sadykov

Very long values are also stored in background tables so that they do not interface with rapid access to shorter column values.

No comments: