Table Stats
Analyze PostgreSQL table sizes, row counts, dead tuple ratios, index scan efficiency, and vacuum history in tpaw.
The Table Stats panel gives you an overview of all tables in your database with metrics sourced from pg_stat_user_tables and pg_relation_size. Use it to identify bloated tables, tables needing vacuuming, or tables with missing indexes.
Metrics per table
| Metric | Source | What it tells you |
|---|---|---|
| Table size | pg_total_relation_size | Total disk usage including indexes and TOAST |
| Live rows | pg_stat_user_tables.n_live_tup | Estimated live row count |
| Dead rows | pg_stat_user_tables.n_dead_tup | Rows deleted/updated but not yet vacuumed |
| Dead % | dead / (live + dead) | Table bloat indicator — high % means vacuum is overdue |
| Seq scans | n_seq_scan | Number of full table scans — high count may indicate missing index |
| Index scans | n_idx_scan | Number of index-based scans |
| Index scan ratio | idx / (seq + idx) | Low ratio = queries rarely use indexes |
| Last vacuum | last_vacuum or last_autovacuum | When dead tuples were last cleaned up |
| Last analyze | last_analyze or last_autoanalyze | When statistics were last updated |
Automated insights
tpaw surfaces table-level warnings automatically:
High dead tuple ratio (>20%)
This table has significant bloat. Run
VACUUM ANALYZE table_name;to reclaim space and update statistics.
Many sequential scans with low index ratio
Queries are doing full table scans. Check if an index on frequently-filtered columns would help.
Vacuum overdue (>7 days)
Autovacuum may not be running, or the table is too busy for autovacuum to keep up. Run
VACUUMmanually during a low-traffic period.
Large table without recent analyze
Query planner statistics are stale. Run
ANALYZE table_name;to update them.
Sorting the table
Click any column header to sort by that metric. Click again to reverse. Useful patterns:
- Sort by Dead % descending to find tables most in need of vacuuming
- Sort by Table size descending to find the largest tables
- Sort by Seq scans descending to find tables with possible missing indexes
Searching
Use the search bar to filter by table name. Useful when you have many tables and want to jump to a specific one.
Running VACUUM manually
To vacuum a specific table, open the Query Editor and run:
VACUUM ANALYZE is safe to run in production. VACUUM FULL acquires an exclusive lock and is disruptive — use it only during maintenance windows.