You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sql/2_table_sizes.sql
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -38,10 +38,10 @@ select
38
38
when row_estimate >10^3 then round(row_estimate::numeric/10^3::numeric, 0)::text||'k'
39
39
else row_estimate::text
40
40
end as rows,
41
-
pg_size_pretty(total_bytes) ||' ('|| round(200* total_bytes::numeric/sum(total_bytes) over (), 2)::text||'%)'as"total (% of all)",
42
-
pg_size_pretty(table_bytes) ||' ('|| round(200* table_bytes::numeric/sum(table_bytes) over (), 2)::text||'%)'as"table (% of all tables)",
43
-
pg_size_pretty(index_bytes) ||' ('|| round(200* index_bytes::numeric/sum(index_bytes) over (), 2)::text||'%)'as"index (% of all indexes)",
44
-
pg_size_pretty(toast_bytes) ||' ('|| round(200* toast_bytes::numeric/sum(toast_bytes) over (), 2)::text||'%)'as"toast (% of all toast data)"
41
+
pg_size_pretty(total_bytes) ||' ('|| round(100* total_bytes::numeric/sum(total_bytes) over (partition by (schema_name is null)), 2)::text||'%)'as"total (% of all)",
42
+
pg_size_pretty(table_bytes) ||' ('|| round(100* table_bytes::numeric/sum(table_bytes) over (partition by (schema_name is null)), 2)::text||'%)'as"table (% of all tables)",
43
+
pg_size_pretty(index_bytes) ||' ('|| round(100* index_bytes::numeric/sum(index_bytes) over (partition by (schema_name is null)), 2)::text||'%)'as"index (% of all indexes)",
44
+
pg_size_pretty(toast_bytes) ||' ('|| round(100* toast_bytes::numeric/sum(toast_bytes) over (partition by (schema_name is null)), 2)::text||'%)'as"toast (% of all toast data)"
0 commit comments