Exploring overall cost

You can explore historical cost using Snowsight, or by writing queries against views in the ACCOUNT_USAGE and ORGANIZATION_USAGE schemas. Snowsight allows you to quickly and easily obtain information about cost from a visual dashboard. Queries against the usage views allow you to drill down into cost data and can help generate custom reports and dashboards.

If you need an introduction to how costs are incurred in Snowflake, refer to Understanding overall cost.

To obtain a billing statement that contains information about historical usage, see Access a billing usage statement.

Granting access to cost and usage data

By default, only account administrators (that is, users with the ACCOUNTADMIN role) have access to cost and usage data. Some features related to viewing costs require the account administrator to also have the ORGADMIN role.

An administrator with the USERADMIN role or higher can use SNOWFLAKE database roles to grant other users access to cost and usage data. You can use the following SNOWFLAKE database roles to provide access:

Required database roles:

All of the following database roles must be granted to a user for them to view cost information in Snowsight:

  • USAGE_VIEWER

  • GOVERNANCE_VIEWER

  • ORGANIZATION_BILLING_VIEWER (Organization Overview page only)

Optional database roles:

For some pages in Snowsight, the ORGANIZATION_BILLING_VIEWER database role is not required. However, granting it to a user allows them to view additional organization-level information like the remaining balance of a contract or amount spent in currency.

To learn how to use SNOWFLAKE database roles to provide access to a user, refer to Using SNOWFLAKE database roles.

Note

Some cost-related information cannot be viewed using database roles. For example, because tagging is reserved for administrators, users with database roles cannot use the Tags filter on the Consumption tab.

Viewing costs using Snowsight

Snowsight provides multiple pages that allow you to explore the historical cost of using Snowflake. For details on using these pages to view overall costs, see:

Note

It can take up to 72 hours for cost information to become available in Snowsight.

Overview of organization-level costs

The Organization Overview page provides insights into how your organization is spending the capacity commitment made in the current contract. For example, it shows you the remaining balance of the contract, the accumulated cost of Snowflake usage since the start of the contract, and the monthly spend for the organization.

It also gives you an overview of how much each account in the organization has spent.

Note

The Organization Overview page is not available in the following cases:

  • The organization uses On Demand accounts rather than a capacity commitment with a contract.

  • The organization signed a contract through a Snowflake reseller.

To access an overview of incurred costs at the organization level:

  1. Sign in to Snowsight.

  2. Do one of the following:

    • If you are the account administrator, switch to the ACCOUNTADMIN role. You must also be granted the ORGADMIN role.

    • If you are not the account administrator, switch to a role with access to cost and usage data.

  3. Select Admin » Cost Management.

  4. Select a warehouse to use to view the usage data. Snowflake recommends using an X-Small warehouse for this purpose.

  5. Select Organization Overview.

The Account Spend Summary tile has a View All option to expand the contents of the tile to include all of the accounts in the organization, not just the accounts that have spent the most. To display the SQL query used to populate this tile, select View All » View query (View query button.) .

Overview of account-level costs

The Account Overview page provides high-level insights into the cost of using Snowflake and can be a starting off point for optimizing your spend.

Note

Account administrators cannot see the price of a credit or usage costs in currency unless they also have the ORGADMIN role.

To access an overview of incurred costs at the account level:

  1. Sign in to Snowsight.

  2. Switch to the ACCOUNTADMIN role. If you are not the account administrator, switch to a role with access to cost and usage data.

  3. Select Admin » Cost Management.

  4. Select a warehouse to use to view the usage data. Snowflake recommends using an X-Small warehouse for this purpose.

  5. Select Account Overview.

Many tiles on the Account Overview page have a View All option to expand the contents of the tile to include more items. For example, for the Top warehouses by cost tile, select View All to open a dialog that displays all warehouses in your account sorted by cost.

To display the SQL query used to populate a tile, select View All » View query (View query button.) . For example, if you view the query for the Top warehouses by cost tile, you see that the data comes from querying the WAREHOUSE_METERING_HISTORY view in the ACCOUNT_USAGE schema of the shared SNOWFLAKE database.

Note

Customers who signed a contract through a Snowflake reseller cannot see the price of a credit or usage in a currency.

Drilling down into incurred costs

You can use the Consumption page to drill down into the overall cost of using Snowflake for any given day, week, or month.

To use Snowsight to drill down into the overall cost:

  1. Sign in to Snowsight.

  2. Switch to the ACCOUNTADMIN role. If you are not the account administrator, switch to a role with access to cost and usage data.

  3. Select Admin » Cost Management.

  4. Select a warehouse to use to view the usage data. Snowflake recommends using an X-Small warehouse for this purpose.

  5. Select Consumption.

  6. Select All Usage Types from the drop-down list.

This totals the cost of compute, storage, and data transfer resources and displays them in a bar graph using the organization’s currency. The total cost of these resources during the selected time period appears above the bar graph.

To isolate the cost of compute, storage, or data transfer, adjust your selection in the All Usage Types filter.

Usage notes

Keep the following in mind when accessing the Consumption page:

  • It can take up to 72 hours for cost information to become available in Snowsight.

  • To access all of the features on the Consumption page, the account administrator must also have the ORGADMIN role. For example, if a user has the ACCOUNTADMIN role, but does not have the ORGADMIN role, they can only view costs for the current account. The Account filter that would allow them to switch to a different account does not appear.

  • If the usage details fail to load with a message indicating that The result set is too large to display, you must use the filters to select a shorter date range or otherwise filter the results.

  • Compute costs do not include queries executed on a warehouse by the SYSTEM user as part of a user-defined task.

Querying data for overall cost

Snowflake provides two schemas, ORGANIZATION_USAGE and ACCOUNT_USAGE, that contain data related to usage and cost. The ORGANIZATION_USAGE schema provides cost information for all of the accounts in the organization while the ACCOUNT_USAGE schema provides similar information for a single account. Views in these schemas provide granular, analytics-ready usage data to build custom reports or dashboards.

The following query combines data from the USAGE_IN_CURRENCY view in the ORGANIZATION_USAGE schema in order to gain insight into the overall cost of using Snowflake.

Query: Total usage costs in dollars for the organization, broken down by account
SELECT account_name,
  ROUND(SUM(usage_in_currency), 2) as usage_in_currency
FROM snowflake.organization_usage.usage_in_currency_daily
WHERE usage_date > DATEADD(month,-1,CURRENT_TIMESTAMP())
GROUP BY 1
ORDER BY 2 desc;
Copy

Next Topics