sysadmin:postgresql
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
sysadmin:postgresql [2014/11/25 08:46] – Query per occupazione disco delle tabelle feroda | sysadmin:postgresql [2014/11/25 17:17] – occupazione db feroda | ||
---|---|---|---|
Line 72: | Line 72: | ||
* [5] = ... tabelle vuote | * [5] = ... tabelle vuote | ||
- | ====== Occupazione disco per tabelle | + | ====== Occupazione disco ====== |
+ | |||
+ | ===== Database ===== | ||
+ | |||
+ | Lo restituisce pure in formato carino :) | ||
+ | |||
+ | # select (pg_database_size(current_database())/ | ||
+ | |||
+ | ===== Tabelle | ||
Restituisce un elenco ordinato in modo discendente di: | Restituisce un elenco ordinato in modo discendente di: | ||
Line 90: | Line 98: | ||
END | END | ||
)::bigint AS estimated_row_count | )::bigint AS estimated_row_count | ||
- | |||
FROM ( | FROM ( | ||
- | |||
SELECT table_schema, | SELECT table_schema, | ||
pg_relation_size('"' | pg_relation_size('"' | ||
Line 98: | Line 104: | ||
FROM information_schema.tables | FROM information_schema.tables | ||
WHERE table_schema NOT IN (' | WHERE table_schema NOT IN (' | ||
- | ORDER BY size DESC, total_size DESC LIMIT 20 | + | ORDER BY size DESC, total_size DESC |
) AS basic_infos | ) AS basic_infos | ||
JOIN pg_class | JOIN pg_class |