This document contains 3 Snowflake SQL queries. The first query selects all columns from the STORAGE_USAGE table in the ACCOUNT_USAGE schema ordered by the USAGE_DATE column descending. The second query selects all columns from the TABLE_STORAGE_METRICS table. The third query selects specific columns including TABLE_NAME, STORAGE_USED_GB, and TIME_TRAVEL_STORAGE_USED_GB from the TABLE_STORAGE_METRICS table and orders the results by STORAGE_USED_GB and then TIME_TRAVEL_STORAGE_USED_GB descending.
This document contains 3 Snowflake SQL queries. The first query selects all columns from the STORAGE_USAGE table in the ACCOUNT_USAGE schema ordered by the USAGE_DATE column descending. The second query selects all columns from the TABLE_STORAGE_METRICS table. The third query selects specific columns including TABLE_NAME, STORAGE_USED_GB, and TIME_TRAVEL_STORAGE_USED_GB from the TABLE_STORAGE_METRICS table and orders the results by STORAGE_USED_GB and then TIME_TRAVEL_STORAGE_USED_GB descending.
This document contains 3 Snowflake SQL queries. The first query selects all columns from the STORAGE_USAGE table in the ACCOUNT_USAGE schema ordered by the USAGE_DATE column descending. The second query selects all columns from the TABLE_STORAGE_METRICS table. The third query selects specific columns including TABLE_NAME, STORAGE_USED_GB, and TIME_TRAVEL_STORAGE_USED_GB from the TABLE_STORAGE_METRICS table and orders the results by STORAGE_USED_GB and then TIME_TRAVEL_STORAGE_USED_GB descending.
SELECT * FROM SNOWFLAKE.ACCOUNT_USAGE.TABLE_STORAGE_METRICS;
// Query time travel storage
SELECT ID, TABLE_NAME, TABLE_SCHEMA, TABLE_CATALOG, ACTIVE_BYTES / (1024*1024*1024) AS STORAGE_USED_GB, TIME_TRAVEL_BYTES / (1024*1024*1024) AS TIME_TRAVEL_STORAGE_USED_GB FROM SNOWFLAKE.ACCOUNT_USAGE.TABLE_STORAGE_METRICS ORDER BY STORAGE_USED_GB DESC,TIME_TRAVEL_STORAGE_USED_GB DESC;