diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-12 18:19:17 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-12 18:19:17 +0200 |
commit | 895e24872de95acf255e0746b42f0661697e7f9a (patch) | |
tree | b2aadbb712549f7aa9caf8679036e9f1535a4f2c /doc/system/plots/dbsize.sql | |
parent | 4d298f9bea8a98acc5d4b7d738af02313b203658 (diff) | |
download | exchange-895e24872de95acf255e0746b42f0661697e7f9a.tar.xz |
initial import of thesis-dold
Diffstat (limited to 'doc/system/plots/dbsize.sql')
-rw-r--r-- | doc/system/plots/dbsize.sql | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/system/plots/dbsize.sql b/doc/system/plots/dbsize.sql new file mode 100644 index 000000000..4f4b23886 --- /dev/null +++ b/doc/system/plots/dbsize.sql @@ -0,0 +1,12 @@ +create temporary view sizes as + select table_name as n, + pg_relation_size(quote_ident(table_name)) / 1024.0 / 1024.0 as s_tbl, + pg_indexes_size(quote_ident(table_name)) / 1024.0 / 1024.0 as s_idx + from information_schema.tables + where table_schema = 'public'; + + +select n, s_tbl, s_idx, s_tbl + s_idx from sizes where (s_tbl) != 0 +order by (s_tbl + s_idx); + +select sum(s_tbl), sum(s_idx), sum(s_tbl + s_idx) from sizes where s_tbl != 0; |