Use the system view SVV_TABLE_INFO or pg_total_relation_size() to quickly find the on-disk size of any Amazon Redshift table.
Knowing table size helps you predict storage costs, tune vacuum and sort strategies, and spot runaway fact tables before they hurt query speed.
SVV_TABLE_INFO exposes table size in MB, uncompressed size, and percent skew without requiring superuser permissions.
SELECT table, size AS mb
FROM SVV_TABLE_INFO
WHERE table = 'orders';
This returns the compressed size of Orders in megabytes.
SELECT table, size AS mb
FROM SVV_TABLE_INFO
ORDER BY size DESC
LIMIT 10;
Sorts all user tables by size to reveal storage hotspots.
SELECT n.nspname AS schema,
c.relname AS table,
size/1024 AS gb,
u.usename AS owner
FROM SVV_TABLE_INFO t
JOIN pg_class c ON c.oid = t.table_id
JOIN pg_namespace n ON n.oid = c.relnamespace
JOIN pg_user u ON u.usesysid = c.relowner
ORDER BY gb DESC;
Adds rich context for multi-team clusters.
SELECT
relname AS table,
pg_total_relation_size(oid) AS bytes
FROM pg_class
WHERE relname = 'orders';
This includes hidden TOAST and index data.
Create a nightly ETL that inserts SVV_TABLE_INFO results into a history table, then chart the trend to catch anomalies early.
Relying on uncompressed_size for billing and ignoring skew columns are frequent pitfalls—see below for fixes.
Use SVV_TABLE_INFO
for summaries and pg_total_relation_size()
when you need byte-level accuracy.
.
Yes. Redshift stores only sort keys; their footprint is already included in the size column returned by SVV_TABLE_INFO.
Sum the size column grouped by schema: SELECT schema, SUM(size) FROM SVV_TABLE_INFO GROUP BY schema;
The view reflects nearly real-time stats but may lag during heavy loads. For strict auditing, snapshot the view on schedule.