Pages in PostgreSQL
What is Page?
- Page is smallest unit of data storage
- Every table and index is stored as an array of pages of fixed size
- By default, in PostgreSQL the size of page is 8kb which configurable
Why do we need a different page size?
- Usually in Datawarehouse, it needs higher page size!
Page Layout
Item | Description |
---|---|
PageHeaderData | 24 bytes long. Contains general information about the page, including free space pointers. |
ItemIdData | Array of item identifiers pointing to the actual items. Each entry is an (offset,length) pair. 4 bytes per item. |
Free space | The unallocated space. New item identifiers are allocated from the start of this area, new items from the end. |
Items | The actual items themselves. |
Special space | Index access method specific data. Different methods store different data. Empty in ordinary tables. |
Reference: https://www.postgresql.org/docs/current/storage-page-layout.html (opens in a new tab)
Reference
https://www.youtube.com/watch?v=RaX6C_xYbV0 (opens in a new tab)