PostgreSQL Advanced Cheat Sheet/Check table bloat stats

Estimate dead tuples and free space in a relation.

Section: Extensions and Specialized Utilities

Check table bloat stats

sql
sql
SELECT * FROM pgstattuple('public.users');
Explanation

See summary for usage details.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Extensions and Specialized Utilities
Enable pgstattuple
Install size and tuple-stat inspection helpers.
OpenIn sheetsqlsame section
Enable pg_trgm
Install trigram support for similarity search and GIN/GiST indexes.
OpenIn sheetsqlsame section
Create trigram index
Accelerate ILIKE and fuzzy matches on text.
OpenIn sheetsqlsame section
Enable citext
Install case-insensitive text type support.
OpenIn sheetsqlsame section
Use CITEXT
Make a column case-insensitive with the `citext` type.
OpenIn sheetsqlsame section
Enable uuid-ossp
Install UUID generation helpers.
OpenIn sheetsqlsame section