Technologies/PostgreSQL/table_size
PostgreSQLPostgreSQLMetric

table_size

Table size bytes
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 (5)

Configuration Parameters (1)
autovacuum_vacuum_scale_factorrecommended: 0.01-0.05
prevents bloat by vacuuming before too many dead tuples accumulate
CLI Commands (1)
SELECT tablename, pg_size_pretty(pg_total_relation_size(quote_ident(tablename)::regclass)) AS total_size, pg_size_pretty(pg_relation_size(quote_ident(tablename)::regclass)) AS table_size, pg_size_pretty(pg_total_relation_size(quote_ident(tablename)::regclass) - pg_relation_size(quote_ident(tablename)::regclass)) AS index_size FROM pg_tables WHERE schemaname = 'public' ORDER BY pg_total_relation_size(quote_ident(tablename)::regclass) DESC LIMIT 10;diagnostic
Technical References (3)
VACUUM FULLcomponentpg_repackcomponenttable bloatconcept
Related Insights (1)
Table bloat wastes disk space without autovacuum full or pg_repackinfo