~/talk

Optimising Column Order for Better Performance & Maintainability

Talkat PGConf India 2025 · 2025-03-05..03-07· [databases]
name:Amul Sul
links:none on file
slides:none on file

Shows that reordering columns to group fixed-width types before varlena removes padding and shrinks row size 56→46 bytes, which on a 1M-row test drops table size 575MB→498MB — 77MB saved. Explains alignment rules (1/2/4/8-byte) and how varlena/TOAST and short varlena headers change in-memory vs on-disk size, demonstrates TOAST compression reducing large repeated text, and ties smaller rows to faster sequential scans, quicker VACUUM/CLUSTER runs and more efficient index use.

AI-written summary · about

  1. 0:00Introduction to column order
  2. 6:28Access latency fundamentals
  3. 10:48Value types in PostgreSQL
  4. 17:00TOAST and variable-length data
  5. 24:38TLE construction and alignment
  6. 29:19Why alignment matters
  7. 33:37Optimization benefits and trade-offs
  8. 37:58Modern hardware considerations
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.