liveBook · Manning

Credit consumption

As explained in Snowflake Data Engineering

Credit consumption is the quantity of Snowflake credits charged for warehouse activity during a period of execution.

Credit consumption measures the Snowflake credits charged for warehouse activity during execution. Data engineers monitor it alongside query performance to balance faster processing against cost, especially when warehouse sizing or long-running queries changes the warehouse’s active time. section 9.0

Estimate and interpret consumption with these operational rules:

  • Convert credits per hour to credits per second by dividing by 3,600, then multiply by total execution time in seconds. section 9.2.2
  • Treat the calculation as an approximation because a warehouse is billed for its initial 60 seconds whenever it starts. section 9.2.2
  • Avoid assigning all warehouse cost to one query when multiple users run queries simultaneously; active warehouse time serves concurrent work. section 9.2.2
  • Compare warehouse sizes over time, starting smaller and increasing size when query duration, spilling, or concurrency justifies it. section 9.0 section 9.2.2
Table 9.3 Calculation of the credits consumed by the query from listing 9.1 using differently sized virtual warehouses
Warehouse size
Credits per hour
Total execution time in seconds
Credits consumed
X-small
1
22
(1/3,600) * 22 = 0.0061
Small
2
10
(2/3,600) * 10 = 0.0056
Medium
4
6
(4/3,600) * 6 = 0.0067
Large
8
4
(8/3,600) * 4 = 0.0089

Compare estimated credits consumed across X-small, small, medium, and large warehouses using hourly credit rates and execution times. section 9.2.2

How Snowflake Data Engineering covers it

How deep it goes
Defines a rough execution-time calculation, then qualifies it with startup billing and shared costs under concurrency.
Examples
Compares one retail-data query across four warehouse sizes using execution time, hourly credits, and local-storage spilling.
What it assumes
Assumes familiarity with Snowflake virtual warehouses, hourly credit rates, and query execution time.
What you can do after
Evaluate warehouse-size tradeoffs by estimating query credits and interpreting startup, spilling, duration, and concurrency effects.
How it connects
Connects credit consumption with virtual warehouses, query execution time, query performance, spilling, and concurrent queries.

This explainer was generated by Manning's knowledge graph from the text of Snowflake Data Engineering. The section links point to the parts of the book it draws on.