Bena H
Bena H

Reputation: 33

Calculate Data Storage for a database in snowflake

Snowflake database storage includes (maybe there are some others)

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:

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

Upvotes: 2

Views: 1656

Answers (2)

Mike Walton
Mike Walton

Reputation: 7369

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.

Upvotes: 2

Rajib Deb
Rajib Deb

Reputation: 1774

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

enter image description here

Upvotes: -1

Related Questions