how to find size of database, schema, table in redshift
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
In Amazon Redshift, storage size is usually something you estimate from system views rather than retrieve from one magical command. The practical workflow is to inspect table size first, then aggregate the same information up to the schema or database level.
Start With svv_table_info
For user tables, svv_table_info is usually the easiest place to start. It exposes one row per table together with operational columns such as row count and storage size in megabytes.
To inspect one table:
That is enough for day-to-day questions such as "which table grew after the last load?" or "did yesterday's backfill double storage?"
If you prefer gigabytes, convert the value explicitly:
Aggregate By Schema
Schema size is just the sum of the tables that belong to that schema. Redshift does not make this harder than it needs to be:
This is useful when teams are separated by schema and you want a rough ownership or chargeback view. The table_count column adds context, because a 500 GB schema made of two giant fact tables is a different operational problem from a 500 GB schema made of hundreds of small tables.
To see which tables dominate the schema:
That query is often the fastest way to decide where cleanup or compression work should begin.
Estimate Database Size
At the database level, a common operational answer is to sum all visible table sizes:
This is not the same as a low-level cluster storage accounting view, but it is usually the number people want for application data footprint. For many dashboards and housekeeping tasks, that estimate is sufficient.
If you want a breakdown at the same time, group by schema:
That gives you an immediate picture of where storage is going.
Read Size Together With Table Health
Storage numbers are most useful when you pair them with maintenance context. svv_table_info also exposes columns such as unsorted and stats_off.
A large table with a high unsorted percentage may need maintenance. A large table with stale statistics may produce poor plans even when storage itself is not the root cause. Size tells you where to look; the additional columns help explain what to do next.
Choose The Right Level Of Detail
When someone asks for "database size," the real question may be cluster billing, user-table storage, or the footprint of one application area. Those are related but not identical.
For most SQL users, table and schema summaries from svv_table_info are the right level because they map directly to work the team can do: archive data, drop old tables, revisit retention, or optimize the largest objects. If you need deeper cluster accounting, use cluster monitoring alongside these SQL views rather than expecting one table-level query to answer every storage question.
Common Pitfalls
- Looking for a single PostgreSQL-style size function and assuming Redshift exposes the same behavior.
- Forgetting that
sizeinsvv_table_infois already measured in megabytes. - Filtering by table name without filtering by schema in an environment with repeated table names.
- Treating table size as the whole performance story instead of checking maintenance signals too.
- Calling the sum of visible tables a cluster-wide storage bill when the question is really about user data footprint.
Summary
- Use
svv_table_infoto inspect table size directly in Redshift. - Sum the same
sizecolumn to estimate schema size or overall visible database footprint. - Convert megabytes to gigabytes explicitly when you want friendlier reporting.
- Read size together with columns such as
unsortedandstats_offso the numbers lead to useful action.
Related reading
- How to find unused Amazon EC2 security groups
- How to fire EC2 instances and upload/run a startup script on each of them?
- How to fix a drifted AWS CloudFormation stack?
- How to fix 'Access Denied' while deleting empty S3 Elastic Beanstalk?
- How to find the index of an element in a TreeSet?
- How to find the mysql data directory from command line in windows
- How to fix apt-get command not found on AWS EC2?
- How to force https on elastic beanstalk?

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.