We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ce7df3 commit b50318fCopy full SHA for b50318f
scripts/get-table-storage-sizes.sql
@@ -0,0 +1,22 @@
1
+SELECT
2
+ table_name,
3
+ pg_size_pretty (table_size) AS table_size,
4
+ pg_size_pretty (indexes_size) AS indexes_size,
5
+ pg_size_pretty (total_size) AS total_size
6
+FROM
7
+ (
8
+ SELECT
9
10
+ pg_table_size (table_name) AS table_size,
11
+ pg_indexes_size (table_name) AS indexes_size,
12
+ pg_total_relation_size (table_name) AS total_size
13
+ FROM
14
15
16
+ ('"' || table_schema || '"."' || table_name || '"') AS table_name
17
18
+ information_schema.tables
19
+ ) AS all_tables
20
+ ORDER BY
21
+ total_size DESC
22
+ ) AS pretty_sizes;
0 commit comments