2
votes

Snowflake database storage includes (maybe there are some others)

  • tables
  • time travel
  • fail safe
  • clones
  • files staged

I am trying to find a way to calculate tables + time-travel + fail-safe with and without clones not using TABLE_STORAGE_METRICS.

Currently looking at ACCOUNT_USAGE.database_storage_usage_history, but I am not sure what is included in AVERAGE_DATABASE_BYTES.

How do I find the correct values for current database?

Edit:

  • I am not an account admin
  • Would like to use query instead of UI

Edit 2: Result from SELECT * FROM INFORMATION_SCHEMA.TABLE_STORAGE_METRICS; With no IMPORTED privilege or permission to view SNOWFLAKE database. enter image description here

2

2 Answers

3
votes

The documentation is a great source of information on this:

https://docs.snowflake.com/en/sql-reference/account-usage/database_storage_usage_history.html#database-storage-usage-history-view

Number of bytes of database storage used, including data in Time Travel.

Per your list, this would include tables, clones (which are tables on their own), and Time Travel.

For stages, you'd need to use the STAGE_STORAGE_USAGE_HISTORY view.

Is there a reason you don't want to use the TABLE_STORAGE_METRICS? Just curious.

-1
votes

If you are an accout admin, you should be able to see this on your snowflake console

enter image description here