Vacuum & bloatadvancedPro runbook

Shrink TOAST bloat from wide rows

Large values live in a separate TOAST table and it bloats independently. A real PG16 lab grew from about 8 MB to 40 MB under four updates; VACUUM FULL brought it back to about 10 MB.

Problem

What you're actually looking at

The symptom as it shows up on a real server.

When a column value is too big for a page, PostgreSQL stores it out-of-line in a TOAST table. That TOAST table has its own dead tuples and its own bloat, which a glance at the main heap size completely misses. You have to size the TOAST relation explicitly.

Meridian stores large document bodies in document_blobs. The main heap is only ~1.3 MB, but updates to the big values have bloated the hidden TOAST table to hundreds of MB.

Simple terms

When a column value is too big to fit on a normal page, PostgreSQL stashes it in a hidden side table called TOAST. That side table collects its own dead rows and bloats on its own, and if you only look at the main table's size, you will miss it completely. The main heap can be tiny while the hidden TOAST table has grown to hundreds of megabytes. You have to check the TOAST size directly to see it.

ProCaptured evidence where the run produced it

Full runbook for this incident

The scenario above is free. What Pro unlocks is the fix: how to identify shrink toast bloat from wide rows, the exact SQL to trace it, PostgreSQL 18 output for the steps we captured, the resolution path, and how to stop it recurring.
  • The full identify checklist, the exact signals that tell you it's this incident
  • Every diagnostic query; lab output is attached only to the steps we actually captured
  • The resolution path and the pitfalls that make it worse
  • Mitigation steps to stop it recurring, plus a verify-you're-done query

Card required. Cancel before day 7 and you are not charged.

Compare plans

Connected

How this connects to the rest of the library

A live view of this page's real cross-references, what explains it, what fixes it, what to tune, and where to go next. Every link is an authored relationship, not a guess.

Open in the interactive map →
ShareLinkedInX

Need the full procedure?

Pro runbooks finish the incident path

Free runbooks teach the shape. Pro opens the full step transcript, edge cases, and prevention depth.

FollowSubstackLinkedInnew errors · lab notes · hiring loops