Understanding Snowflake Virtual Warehouse, Storage, and Cloud Services Usage

Snowflake brings unprecedented flexibility and scalability to data warehousing. The goal of Snowflake pricing is to enable these capabilities at a low cost in the simplest possible way.

The Snowflake cloud architecture separates data warehousing into three distinct functions: compute resources (implemented as virtual warehouses), data storage, and cloud services. The costs associated with using Snowflake are based on your usage of each of these functions.

In this Topic:

Virtual Warehouse Credit Usage

A virtual warehouse is one or more compute clusters that enable customers to execute queries, load data, and perform other DML operations. Snowflake credits are used to pay for the processing time used by each virtual warehouse.

Snowflake credits are charged based on the number of virtual warehouses you use, how long they run, and their size.

Warehouses come in eight sizes. The size specifies the number of servers per cluster in the warehouse. There is a one-to-one correspondence between the number of servers in a warehouse cluster and the number of credits billed for each full hour that the warehouse runs:

X-Small

Small

Medium

Large

X-Large

2X-Large

3X-Large

4X-Large

1

2

4

8

16

32

64

128

Important

  • Warehouses are only billed for credit usage when they are running. When a warehouse is suspended, it does not accrue any credit usage.

  • The credit numbers shown here are for a full hour of usage; however, credits are billed per-second, with a 60-second (i.e. 1-minute) minimum:

    • Each time a warehouse is started or resized to a larger size, the warehouse is billed for 1 minute’s worth of usage based on the hourly rate shown above.

    • After 1 minute, all subsequent billing is per-second.

    • Stopping and restarting a warehouse within the first minute does not change the amount billed; the minimum billing charge is 1 minute.

    • When a warehouse is increased in size, credits are billed only for the additional servers that are provisioned. For example, changing from Small (2) to Medium (4) results in billing charges for 1 minute’s worth of 2 credits.

For more details, see Overview of Warehouses and Warehouse Considerations.

Viewing Warehouse Credit Usage for Your Account

Users with the ACCOUNTADMIN role can use the Snowflake web interface or SQL to view monthly and daily credit usage for all the warehouses in your account.

To view warehouse credit usage for your account:

Web Interface

Click on Account Account tab » Billing & Usage

SQL

Query the WAREHOUSE_METERING_HISTORY table function (in the Information Schema).

Cloud Services Credit Usage

The cloud services layer is a collection of services that coordinate activities across Snowflake. These services tie together all of the different components of Snowflake in order to process user requests, from login to query dispatch. The cloud services layer also runs on compute instances provisioned by Snowflake from the cloud provider.

Among the services in this layer:

  • Authentication

  • Infrastructure management

  • Metadata management

  • Query parsing and optimization

  • Access control

Similar to virtual warehouse usage, Snowflake credits are used to pay for the usage of the cloud services that exceeds 10% of the daily usage of the compute resources.

Usage for cloud-services is charged only if the daily consumption of cloud services exceeds 10% of the daily usage of the compute resources. The charge is calculated daily (in the UTC time zone). This ensures that the 10% adjustment is accurately applied each day, at the credit price for that day.

Understanding Billing for Cloud Services Usage

  • The 10% adjustment for cloud services is calculated daily (in the UTC time zone) by multiplying daily compute by 10%.

  • The adjustment on the monthly usage statement is equal to the sum of these daily calculations.

  • If cloud services consumption is less than 10% of compute credits on a given day, then the adjustment for that day is equal to the cloud services the customer used. The daily adjustment will never exceed actual cloud services usage for that day. Thus, the total monthly adjustment may be significantly less than 10%.

For example:

Date

Compute Credits

Credits Cloud Services

Credits Adjustment for Included Cloud Services (Minimum of Cloud Services or 10% of Compute)

Credits Billed (the sum of Compute, Cloud Services, and Adjustment)

Nov 1

100

20

-10

110

Nov 2

120

10

-10

120

Nov 3

80

5

-5

80

Nov 4

100

13

-10

103

Total

400

48

-35

413

Viewing Cloud Services Credit Usage

Users with ACCOUNTADMIN role can use the Snowflake web interface or SQL to view daily and monthly Cloud Services credit usage by warehouse and job.

To view cloud services credit usage for your account:

Web Interface

Click Account Account tab » Billing & Usage

SQL

ACCOUNT_USAGE:

INFORMATION_SCHEMA:

Note

The adjustment for included cloud services (up to 10% of compute), is shown only on the monthly usage statement and in the METERING_DAILY_HISTORY view. The information viewable in the UI and in the WAREHOUSE_METERING_HISTORY view will not take into account this adjustment, and may therefore be greater than your actual credit consumption.

How to Find out Where Your Cloud Services Usage is Coming From

Use the following queries to look at your cloud services usage.

Query History

Example: Find queries by type that consume the most cloud services credits

-- The current role must have access to the account usage share
use schema snowflake.account_usage;

select query_type, sum(credits_used_cloud_services) cs_credits, count(1) num_queries
from query_history
where true
and start_time >= timestampadd(day, -1, current_timestamp)
group by 1
order by 2 desc
limit 10;

Example: Find queries of a given type that consume the most cloud services credits

-- The current role must have access to the account usage share
use schema snowflake.account_usage;

select *
from query_history
where true
  and start_time >= timestampadd(day, -1, current_timestamp)
  and query_type = 'COPY'
order by credits_used_cloud_services desc
limit 10;

Example: Sort by different components of cloud services usage

-- The current role must have access to the account usage share
use schema snowflake.account_usage;

select *
from query_history
where true
  and start_time >= timestampadd(minute, -60, current_timestamp)
  and query_type = 'COPY'   --- optional
order by compilation_time desc,
               execution_time desc,
               list_external_files_time desc,
               queued_overload_time desc,
               credits_used_cloud_services desc
limit 10;

Warehouse History

Example: Find warehouses that consume the most cloud services credits

-- The current role must have access to the account usage share
use schema snowflake.account_usage;

select warehouse_name,
       sum(credits_used_cloud_services) credits_used_cloud_services,
       sum(credits_used_compute) credits_used_compute,
       sum(credits_used) credits_used
from warehouse_metering_history
where true
  and start_time >= timestampadd(day, -1, current_timestamp)
group by 1
order by 2 desc
limit 10;

Data Storage Usage

Data storage is calculated monthly based on the average number of on-disk bytes for all data stored each day in your Snowflake account, including:

  • Files stored in Snowflake locations (i.e. user and table stages or internal named stages) for bulk data loading/unloading. The user who stages a file can choose whether or not to compress the file to reduce storage.

  • Data stored in database tables, including historical data maintained for Time Travel. Snowflake automatically compresses all data stored in tables and uses the compressed file size to calculate the total storage used for an account.

  • Historical data maintained for Fail-safe.

The monthly costs for storing data in Snowflake is based on a flat rate per terabyte (TB). The amount charged per TB depends on your type of account (Capacity or On Demand) and region (US or EU). For data storage pricing, see the pricing page (on the Snowflake website).

Viewing Data Usage for Your Account

Users with the ACCOUNTADMIN role can use the Snowflake web interface or SQL to view average monthly and daily data storage (in bytes) for your account.

To view data storage (for tables, stages, and Fail-safe) for your account:

Web Interface

Click on Account Account tab » Billing & Usage

SQL

Query the following table functions (in the Information Schema):

Viewing Data Usage for a Table

Users with the appropriate access privileges can use either the web interface or SQL to view the size (in bytes) of individual tables in a schema/database:

Web Interface

Click on Databases Databases tab » <db_name> » Tables

SQL

Execute a SHOW TABLES command.

In addition, users with the ACCOUNTADMIN role can use SQL to view table size information:

SQL

Query the TABLE_STORAGE_METRICS view (in the Information Schema).

Important

The size displayed for a table represents the number of bytes that will be scanned if the entire table is scanned in a query; however, this number may be different from the number of physical bytes (i.e. bytes stored on-disk) for the table, specifically for cloned tables and tables with deleted data:

  • A cloned table does not utilize additional storage (until rows are added to the table or existing rows in the table are modified or deleted). As a result, the table size displayed may be larger than the actual physical bytes stored for the table, i.e. the table contributes less to the overall data storage for the account than the size indicates.

  • Data deleted from a table is not included in the displayed table size; however, the data is maintained in Snowflake until both the Time Travel retention period (default is 1 day) and the Fail-safe period (7 days) for the data has passed. During these two periods, the table size displayed is smaller than the actual physical bytes stored for the table, i.e. the table contributes more to the overall data storage for the account than the size indicates.

For more information about storage for cloned tables and deleted data, see Data Storage Considerations.