Technologies/PostgreSQL/postgresql.table.size
PostgreSQLPostgreSQLMetric

postgresql.table.size

Table disk size
Dimensions:None
Available on:DatadogDatadog (1)PrometheusPrometheus (1)
Interface Metrics (2)
DatadogDatadog
Enabled with `relations`. The disk space used by the specified table with TOAST data. Free space map and visibility map are not included. This metric is tagged with db, schema, table.
Dimensions:None
PrometheusPrometheus
Total disk space used by this table, in bytes
Dimensions:None

Technical Annotations (16)

CLI Commands (9)
SELECT relname, n_live_tup, n_dead_tup, pg_size_pretty(pg_total_relation_size(oid)) FROM pg_stat_user_tables WHERE schemaname = 'public';diagnostic
VACUUM FULL table_name;remediation
SELECT schemaname, relname, pg_size_pretty(pg_total_relation_size(schemaname || '.' || relname)) as size FROM pg_stat_user_tables ORDER BY pg_total_relation_size(schemaname || '.' || relname) DESC LIMIT 10;diagnostic
VACUUM ANALYZE;remediation
VACUUM FULL my_large_table;remediation
SELECT relpages, reltuples FROM pg_class WHERE relname='table_name'diagnostic
CREATE TABLE events (...) PARTITION BY RANGE (created_at);remediation
CREATE TABLE events_2026_01 PARTITION OF events FOR VALUES FROM ('2026-01-01') TO ('2026-02-01');remediation
SELECT partman.create_parent('public.events', 'created_at', 'native', 'monthly', p_premake := 3);remediation
Technical References (7)
dead tuplesconceptVACUUM FULLcomponentautovacuumcomponentmain table forkcomponentpg_partmancomponentPARTITION BY RANGEconceptpartition pruningconcept
Related Insights (4)
Dead tuples accumulate massively when autovacuum is blocked from cleanupcritical
Table bloat consuming excessive disk spacewarning
Table bloat increases sequential scan cost linearlywarning
Large table sequential scans degrade at 100M+ rows despite proper indexingwarning