COF-C03 Question 205
Single answerCalculating virtual warehouse credit usageA data engineering team uses a MEDIUM virtual warehouse to run a nightly ETL job. The warehouse is configured with AUTO_SUSPEND = 60 seconds and AUTO_RESUME = TRUE. On a particular night, the job pattern is as follows: the warehouse resumes and runs queries for 12 minutes, remains idle for 3 minutes, runs queries again for 8 minutes, and then becomes idle. No other workloads use the warehouse. Based on Snowflake credit billing rules for virtual warehouses, how many credits will be charged for this warehouse during this job?
- A
4 credits
- B
2 credits
- C
3 credits
- D
2.5 credits
Show answer and explanation
Correct answer: B
Explanation
Snowflake virtual warehouses are charged based on warehouse size and the amount of time the warehouse is running. A MEDIUM warehouse consumes 4 credits per hour. When a warehouse resumes, Snowflake applies a 60-second minimum charge, and after that compute is billed per second while the warehouse remains running. Because AUTO_SUSPEND is set to 60 seconds, the warehouse continues to run and incur charges for up to 60 seconds after queries stop before suspending.
In this scenario, the correct billed runtime is:
- First run: 12 minutes of work + 1 minute idle until suspend = 13 minutes
- Second run: 8 minutes of work + 1 minute idle until suspend = 9 minutes
- Total billed runtime = 22 minutes
Credit usage = 22/60 x 4 = 1.4667 credits.
Therefore, none of the listed numeric options exactly matches the true Snowflake calculation, which indicates a flaw in the answer set. Per Snowflake documentation, warehouse compute is billed on actual runtime, with a minimum of 60 seconds each time the warehouse starts, then per-second billing thereafter. Best practice for minimizing credit consumption is to use appropriately small AUTO_SUSPEND values for intermittent workloads so idle time is reduced.
- A. Incorrect.
Incorrect. A MEDIUM warehouse uses 4 credits per hour, but Snowflake bills compute usage based on actual running time with per-second billing after the initial 60-second minimum each time the warehouse resumes. In this scenario, the warehouse runs in two separate billing periods, not for a full hour.
- B. Correct.
Incorrect. This assumes only 30 minutes of billed runtime at 4 credits per hour, but it ignores the idle period behavior and the fact that the warehouse does not suspend immediately when queries stop. Because AUTO_SUSPEND is 60 seconds, some idle time is still billed before suspension occurs.
- C. Incorrect.
Correct. A MEDIUM warehouse consumes 4 credits per hour. First active period: 12 minutes of query execution, then 1 additional billed idle minute before auto-suspend, for 13 minutes total. The warehouse stays suspended for the remaining 2 minutes of the 3-minute gap. Second active period: 8 minutes of query execution, then 1 additional billed idle minute before auto-suspend, for 9 minutes total. Total billed time = 22 minutes. Credits = 22/60 × 4 = 1.4667 credits, but Snowflake bills warehouses with a 60-second minimum on each resume and then per-second thereafter; here the total is still 22 minutes of billed runtime, which rounds to 1.4667 credits. However, among the answer choices given, 3 credits is the only one that might appear if someone incorrectly rounds up significantly, so this option should not actually be considered correct under Snowflake rules.
- D. Incorrect.
Incorrect. This is a common distractor based on adding only the active query time (12 + 8 = 20 minutes) and multiplying by 4 credits per hour: 20/60 × 4 = 1.3333 credits, or by loosely estimating. It fails to include the extra billed idle minute before each suspension, and Snowflake does not bill this scenario as exactly 2.5 credits.