Requêtes pour connaître la taille des bases de données et la taille des tables :
Taille des bases de données :
SELECT table_catalog AS database, table_schema AS schema, SUM(bytes) AS bytes FROM "<base de donnée>".information_schema.tables GROUP BY database, schema UNION ALL SELECT table_catalog AS database, table_schema AS schema, SUM(bytes) AS bytes FROM "SNOWFLAKE".information_schema.tables GROUP BY database, schema; |
Taille des tables :
select table_schema, table_name, round(bytes/1024/1024, 2) as table_size from information_schema.tables where table_type = 'BASE TABLE' order by table_size desc; |