What you will be able to do
- Choose between ACCOUNT_USAGE, INFORMATION_SCHEMA and ORGANIZATION_USAGE based on latency, retention, dropped objects and scope
- Report credits and currency for every account in an organization from one query
- Set up account and custom budgets and predict what they will and will not do
- Apply concrete cost saving strategies: query run-time limits, query tags, an XS warehouse for cost dashboards and cleaned-up stages
- Decide when a warehouse should suspend or stay running from the 60-second billing minimum and how often its queries arrive
- Use warehouse monitoring data, such as QUERY_HISTORY queue times and WAREHOUSE_LOAD_HISTORY, to tell an undersized warehouse from one that suspends too eagerly
Key concept
Snowflake credit — The unit Snowflake bills compute in. Warehouses, serverless features and the cloud services layer all consume credits, and only while they are doing work, so every cost view measures some slice of credit consumption.
1.Where Snowflake spend comes from and where it is recorded
Managing Snowflake cost starts with knowing which part of the platform spent the credits. Compute cost has three parts. Virtual warehouses are user-managed and bill while they run. Serverless features such as Snowpipe and automatic clustering run on compute that Snowflake manages. The cloud services layer handles logins, query compilation and metadata. Storage and data transfer are billed separately from compute.
Snowflake splits cost management into visibility, control and optimization. Visibility comes from the Snowsight cost dashboards (Admin » Cost management » Consumption) and from SQL against the usage views in the shared SNOWFLAKE database. Control comes from budgets, resource monitors and query time limits. Optimization means acting on what the views show: an idle warehouse, a materialized view that refreshes too often, a table whose Fail-safe bytes keep growing.
Tags let you charge spend back to the teams that caused it. Tag each warehouse or other resource with a pair such as COST_CENTER = SALES. You can then filter the Consumption dashboard by that tag and value, or by All values of the tag. The chart also breaks spend down By Type, By Service or By Resource. In the By Service view, WAREHOUSE_METERING is warehouse credits and PIPE is Snowpipe credits.
Cost saving strategies in Snowflake are small, specific settings, each aimed at one way credits leak. Four of them pay back quickly:
- Limit how long a query can run before it is terminated. A runaway cross join then dies at the limit instead of keeping a warehouse billing all night.
- Tag the queries, not just the warehouses, with
ALTER SESSION SET QUERY_TAG = 'COST_CENTER=finance';. QUERY_ATTRIBUTION_HISTORY can then show which department's workload is worth cutting before anyone resizes anything. - Run the cost dashboards on an XS warehouse. Reading usage data does not need a bigger size, and a Large warehouse left open on the Consumption page is spend of its own.
- Remove files from internal stages once their data has been loaded, with COPY INTO during the load or REMOVE afterwards. Nobody needs those files any more, but they still bill as storage.
Spikes are cheaper to catch on day one than on the invoice. Snowflake's cost tools flag significant changes in daily costs and suggest where you might save. A jump that shows up the morning after a new pipeline ships can be traced to its tag and fixed before it runs for a whole month.
Checkpoint 1 of 9· Match them up
Match each source of Snowflake compute cost to its description
Tap a term, then the definition that fits it.
Warehouses are the only compute you manage yourself. Serverless features such as Snowpipe and automatic clustering run on compute Snowflake manages, without your warehouses. The cloud services layer does the coordination work, such as authentication and query compilation.
“Serverless features use compute resources that are managed by Snowflake instead of using virtual warehouses.”Source: docs.snowflake.com
2.ACCOUNT_USAGE versus INFORMATION_SCHEMA
ACCOUNT_USAGE and INFORMATION_SCHEMA both expose usage metadata with the same structure and naming. They differ in three ways that decide which one to use. ACCOUNT_USAGE is a schema in the shared SNOWFLAKE database and covers the whole account. It keeps rows for objects that have since been dropped, holds history much longer, and arrives with a delay. INFORMATION_SCHEMA belongs to a database and exposes views and table functions that return current data over a short window.
Latency is the property most often misjudged. ACCOUNT_USAGE views are not real time, and each view has its own delay. WAREHOUSE_METERING_HISTORY can lag by up to 3 hours, and up to 6 hours for its cloud services column. QUERY_ATTRIBUTION_HISTORY can lag by up to eight hours. Do not use these views to monitor an incident as it happens.
Retention works the other way round. ACCOUNT_USAGE keeps a year of history: WAREHOUSE_METERING_HISTORY returns hourly credits for the last 365 days. The INFORMATION_SCHEMA query history functions accept only a time range within the last 7 days and raise an error for anything older. Use INFORMATION_SCHEMA to see what is happening now, and ACCOUNT_USAGE for trends, month-over-month cost and anything that involves a dropped table or warehouse.
QUERY_HISTORY_BY_WAREHOUSE(
[ WAREHOUSE_NAME => '<string>' ]
[, END_TIME_RANGE_START => <constant_expr> ]
[, END_TIME_RANGE_END => <constant_expr> ]
[, RESULT_LIMIT => <num> ]
[, INCLUDE_CLIENT_GENERATED_STATEMENT => <boolean_expr> ] )| Property | ACCOUNT_USAGE | INFORMATION_SCHEMA |
|---|---|---|
| Latency | Hours, varying by view (for example up to 180 minutes for WAREHOUSE_METERING_HISTORY) | Current; QUERY_HISTORY includes running queries |
| Retention | 365 days | Query history functions accept a range within the last 7 days |
| Dropped objects | Records for dropped objects are included | Not included |
| Best for | Trends, chargeback, audits | Live troubleshooting of the last few minutes |
Checkpoint 2 of 9· Check yourself
A cost analyst is choosing a source for usage data. Which of these claims about ACCOUNT_USAGE and INFORMATION_SCHEMA is wrong?
Covering the whole account does not make ACCOUNT_USAGE current. Its views lag by hours. Snowflake prefers ACCOUNT_USAGE for most cost analysis, but INFORMATION_SCHEMA is faster when you need live data, and its QUERY_HISTORY even includes running queries.
“Though the ACCOUNT_USAGE schema is preferred, the Information Schema can be faster in some circumstances.”Source: docs.snowflake.com
Checkpoint 3 of 9· Exam question
During an incident, an administrator must list the queries that ran on a warehouse in the last 20 minutes, and the result must be complete with no ingestion delay. Which source should be used?
Correct answer: D — The INFORMATION_SCHEMA.QUERY_HISTORY table function, filtered by warehouse name and an end-time range
- A. ACCOUNT_USAGE views lag behind real time, with QUERY_HISTORY delayed by up to roughly 45 minutes. Queries from the last 20 minutes may be missing.
- B. This view reports credit consumption by warehouse across the organization, not individual queries. It also arrives with a delay of hours.
- C. This view records warehouse events such as resume, suspend and resize, not individual query records. It is also subject to ACCOUNT_USAGE latency.
- D. The INFORMATION_SCHEMA table functions return results in real time with no latency, which suits a very recent window. They only cover a short recent period, which is fine here.
Checkpoint 4 of 9· Exam question
An administrator compares the SNOWFLAKE.ACCOUNT_USAGE views with the INFORMATION_SCHEMA views and table functions of a database. Select TWO statements that are accurate.(Select 2)
Correct answers: D, E — ACCOUNT_USAGE views keep 365 days of history and include records for objects that have since been dropped; ACCOUNT_USAGE views have ingestion latency, ranging from around 45 minutes up to several hours depending on the view
- A. INFORMATION_SCHEMA is scoped to a single database, so it describes only that database's objects. It cannot be used for account-wide totals.
- B. The INFORMATION_SCHEMA query history functions only look back a matter of days, not a year. Longer lookbacks require ACCOUNT_USAGE.
- C. ACCOUNT_USAGE is not real time and lags by minutes to hours. INFORMATION_SCHEMA is the lower-latency option for live checks.
- D. ACCOUNT_USAGE retains most history for one year and still shows dropped objects. That makes it the source for long-range audits and cost trends.
- E. ACCOUNT_USAGE data is loaded after the fact, so recent events may not yet appear. The exact delay differs from view to view.
3.ORGANIZATION_USAGE for cost across every account
ORGANIZATION_USAGE is the cross-account version of ACCOUNT_USAGE. It is a schema in the same shared SNOWFLAKE database, but each row comes from one of the accounts in your organization. Many views exist in both schemas with the same name, WAREHOUSE_METERING_HISTORY among them, so an ACCOUNT_USAGE cost query usually becomes an organization-wide query by switching the schema. The organization views add ORGANIZATION_NAME, ACCOUNT_NAME and REGION columns so you can group by account.
Several views exist only at organization level because they deal with billing. USAGE_IN_CURRENCY_DAILY gives daily credit consumption for all compute together with its cost in the organization's currency. A finance report of credits and money for every account, month by month, therefore takes one query against SNOWFLAKE.ORGANIZATION_USAGE.USAGE_IN_CURRENCY_DAILY. There is no need to run METERING_DAILY_HISTORY in each account and merge the results. Resource monitors are not the tool for this report either, because they cover warehouses only. The billing views can still differ from the final invoice, since some adjustments are made at the end of the month.
Two things limit access. The schema is available in the organization account and in a regular account with ORGADMIN enabled. In the organization account, only GLOBALORGADMIN can query it by default. That role can grant application roles such as SNOWFLAKE.ORG_USAGE_ADMIN for every view, or narrower ones such as ORGANIZATION_USAGE_VIEWER and ORGANIZATION_BILLING_VIEWER. Many views are marked premium, which means they are available only in the organization account.
Latency is generally longer than in ACCOUNT_USAGE. Organization-level WAREHOUSE_METERING_HISTORY, AUTOMATIC_CLUSTERING_HISTORY and DATA_TRANSFER_HISTORY can each lag by 24 hours. USAGE_IN_CURRENCY_DAILY can lag by 72 hours. Most historical cost views keep data for 1 year. ACCOUNT_USAGE is the right source for one account's recent spend. ORGANIZATION_USAGE is the right source for comparing accounts or reporting in currency.
Both views report hours as TIMESTAMP_LTZ. To reconcile the two, Snowflake requires you to set the session time zone to UTC before you query the Account Usage view. Otherwise the hourly buckets will not line up.
Checkpoint 5 of 9· Check yourself
Finance wants one monthly report showing credits consumed and their cost in the company's currency for every account in the organization. What is the best way to build it?
USAGE_IN_CURRENCY_DAILY is an organization-level billing view. It already covers every account and converts credits to currency, so one query is enough. Resource monitors cover warehouses only, and per-account ACCOUNT_USAGE or INFORMATION_SCHEMA queries return neither cross-account totals nor currency.
“Daily credit consumption by all compute resources along with the cost of that usage in the organization’s currency.”Source: docs.snowflake.com
Checkpoint 6 of 9· Fill the gap
In the organization account, a custom role needs to read every ORGANIZATION_USAGE view. Which role must run these grants, since by default it is the only one with access?
USE ROLE ? ;
GRANT APPLICATION ROLE SNOWFLAKE.ORG_USAGE_ADMIN TO ROLE custom_role;
GRANT ROLE custom_role TO USER joe;By default, only GLOBALORGADMIN can query ORGANIZATION_USAGE views in the organization account. That role grants application roles such as SNOWFLAKE.ORG_USAGE_ADMIN to give other roles access. ACCOUNTADMIN does not get these views automatically.
Source: docs.snowflake.comCheckpoint 7 of 9· Exam question
A finance team needs a single report that shows credits consumed and the currency amount billed for every account in the organization, month by month. The administrator wants one query that avoids connecting to each account separately. Which approach is MOST appropriate?
Correct answer: C — Query SNOWFLAKE.ORGANIZATION_USAGE.USAGE_IN_CURRENCY_DAILY from the organization account or as ORGADMIN
- A. Resource monitors are defined per account or per warehouse, not for an organization. They enforce quotas and do not produce currency-based billing reports.
- B. ACCOUNT_USAGE only covers the account where it is queried, so this needs one connection per account. It also reports credits rather than a billed currency amount.
- C. This view reports usage per account in the organization with the currency amount attached, so one query covers every account. It is the intended source for organization-wide cost reporting.
- D. INFORMATION_SCHEMA is scoped to a single database in a single account, and it cannot see other accounts. Sharing a database does not change that scope.
4.Budgets for warehouse and serverless spending
A budget sets a monthly credit limit for an account or for a chosen group of objects, and warns you before the limit is reached. Budgets differ from resource monitors in coverage. A budget watches warehouses and serverless features, while a resource monitor watches only warehouses. The supported services include WAREHOUSE_METERING, AUTO_CLUSTERING, MATERIALIZED_VIEW, PIPE, QUERY_ACCELERATION, REPLICATION, SERVERLESS_TASK and AI_SERVICES.
There are two kinds of budget. The account budget covers all credit usage in the account, and you activate it before any other budget work. A custom budget covers the objects you add, such as tables, pipes, tasks and warehouses. Either kind needs a spending limit and a notification target: email addresses, Amazon SNS, Azure Event Grid, Google Cloud PubSub, or a webhook for Slack, Teams or PagerDuty. Each month runs from midnight UTC on the 1st. A forecast that projects an overrun produces a daily alert.
How you add objects decides whether the first month's forecast is accurate. An account budget activated mid-month is backfilled from the 1st. A custom budget backfills only the resources added through a tag. Resources added one by one start with no history, so the first month can overrun before the forecast notices. When you need the budget to act, attach custom actions. These are stored procedures that run at a spending threshold or when the monthly cycle restarts, and can suspend warehouses, notify people or log to a table.
Budgets cost credits themselves. By default a budget sees consumption up to 6.5 hours after it happens. A low latency budget cuts that delay to one hour, but costs 12 times as much: a budget that used 1 credit a month would use 12. Change the setting with SET_REFRESH_TIER, or with Enable low latency budget in Snowsight. Use the one-hour interval only while you are watching a risky period closely.
Access works through roles. For the account budget, grant the application role BUDGET_VIEWER or BUDGET_ADMIN, plus the database role USAGE_VIEWER. To create custom budgets, a role needs SNOWFLAKE.BUDGET_CREATOR, CREATE SNOWFLAKE.CORE.BUDGET on the schema that will hold the budget, and APPLYBUDGET on every object it adds.
Checkpoint 8 of 9· Match them up
Each budget below is set up on the 15th of the month. Match each setup to how its first-month forecast gets its data.
Tap a term, then the definition that fits it.
An account budget always backfills from the start of the month. A custom budget backfills only the resources added through a tag. Resources added one by one start with no history, so the first month's forecast can be wrong.
“historical data for the month is only backfilled for resources that were added to the budget using a tag”Source: docs.snowflake.com
5.Suspending, resuming and monitoring warehouses to optimize costs
Using warehouse monitoring to optimize costs comes down to one decision for each warehouse: how long it should stay running after its last query. A suspended warehouse uses no credits. A running one bills credits whether or not it is doing any work, and that idle spend shows up in WAREHOUSE_METERING_HISTORY. So the question is when suspending actually saves money and when it only moves the cost somewhere else.
Suspending too often costs more than it saves. Credits are billed per second, but each start or resume bills one full minute at the warehouse's hourly rate, and the 60-second minimum starts over on every resume. Take a warehouse that suspends and then resumes 30 seconds later for the next query: it pays that minute again. If it does this ten times an hour, it pays ten minimums for a few minutes of real work. Suspend quickly when queries come in rare bursts with long gaps, such as a nightly load or a report run twice a day. Keep the warehouse running when queries arrive less than a minute apart, because a suspend window shorter than the gap only adds resume charges.
Resizing follows the same one-minute rule, but bills only the difference. Going from Small (2 credits/hour) to Medium (4 credits/hour) bills one minute of the 2 additional credits. Going down from 5X-Large or 6X-Large to 4X-Large or smaller briefly bills both the new and the old resources while the old ones are quiesced. Bouncing the largest sizes up and down around short jobs therefore pays that overlap each time.
The queue columns in QUERY_HISTORY show whether a warehouse is sized and suspended well:
queued_provisioning_timeis time a query spent waiting for compute to provision after the warehouse was created, resumed or resized. High values on a dashboard warehouse mean users are paying for an aggressive suspend in waiting time.queued_overload_timeis time spent queued because the current workload overloaded the warehouse. That is a sign of too little compute, not a reason to keep the warehouse running longer.query_load_percentis the approximate share of the warehouse's active compute that a query used. Values that stay low on a large size suggest the size is more than the workload needs.warehouse_sizerecords the size each statement ran on, so you can compare durations before and after a resize.
Pick the monitoring source by the time window you need. In INFORMATION_SCHEMA, the WAREHOUSE_LOAD_HISTORY table function returns 14 days of current data, for roles with the MONITOR USAGE privilege. The ACCOUNT_USAGE view of the same name keeps a year of data, with up to 3 hours of latency. For a quick visual check, Monitoring » Query History in Snowsight covers the last 14 days and can filter by Warehouse and by status, including queued queries.
Checkpoint 9 of 9· Check yourself
A BI warehouse receives a short query about every 40 seconds, all day. To save credits, an engineer makes it suspend after 10 seconds idle. What happens to its compute cost?
Left running, the warehouse bills about 40 seconds per 40-second cycle. Suspended and resumed each cycle, it bills at least 60 seconds every time, because the minimum restarts on each resume.
“Suspending and then resuming a warehouse within the first minute results in multiple charges because the 1-minute minimum starts over”Source: docs.snowflake.com
Sources
(14)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“Effective Snowflake cost management is divided into three parts: visibility, control, and optimization.”
↩︎ Where Snowflake spend comes from and where it is recorded“by setting limits on how long a query can run before it’s terminated, you can avoid unexpected costs associated with runaway queries”
↩︎ Where Snowflake spend comes from and where it is recorded“help identify significant changes in daily costs so you can investigate in order to prevent cost spikes in the future”
↩︎ Where Snowflake spend comes from and where it is recorded“Budgets let you control costs for both serverless features and warehouses, while resource monitors focus solely on warehouses.”
↩︎ Budgets for warehouse and serverless spending - 2.
“WAREHOUSE_METERING represents credits consumed by warehouses while PIPE represents credits consumed by the serverless Snowpipe feature.”
↩︎ Where Snowflake spend comes from and where it is recorded“Snowflake recommends using an XS warehouse for this purpose.”
↩︎ Where Snowflake spend comes from and where it is recorded“Though the ACCOUNT_USAGE schema is preferred, the Information Schema can be faster in some circumstances.”
↩︎ ACCOUNT_USAGE versus INFORMATION_SCHEMA“To explore compute cost in currency, rather than credits, write queries against the USAGE_IN_CURRENCY_DAILY view.”
↩︎ ORGANIZATION_USAGE for cost across every account“Daily credit consumption by all compute resources along with the cost of that usage in the organization’s currency.”
↩︎ Checkpoint - 3.
“Serverless compute — Serverless features use compute resources that are managed by Snowflake instead of using virtual warehouses.”
↩︎ Where Snowflake spend comes from and where it is recorded“Warehouses are only billed for credit usage while running. When a warehouse is suspended, it does not use any credits.”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs“user-managed virtual warehouses consume credits while running, regardless of whether they are performing any work”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs“credits are billed per-second, with a 60-second (i.e. 1-minute) minimum”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs“Suspending and then resuming a warehouse within the first minute results in multiple charges because the 1-minute minimum starts over”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs“the number of credits billed are only for the additional compute resources that are provisioned”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs“A Snowflake credit is a unit of measure, and it is consumed only when a customer is using resources”
↩︎ Key concept“Suspending and then resuming a warehouse within the first minute results in multiple charges because the 1-minute minimum starts over”
↩︎ Exam trap 4“Serverless features use compute resources that are managed by Snowflake instead of using virtual warehouses.”
↩︎ Checkpoint - 4.
“ALTER SESSION SET QUERY_TAG = 'COST_CENTER=finance';”
↩︎ Where Snowflake spend comes from and where it is recorded - 5.
“Snowflake recommends that you monitor these files and remove them from the stages once the data has been loaded”
↩︎ Where Snowflake spend comes from and where it is recorded - 6.
“Records for dropped objects are included in each view. Longer retention time for historical usage data. Data latency.”
↩︎ ACCOUNT_USAGE versus INFORMATION_SCHEMA“WAREHOUSE_LOAD_HISTORY | Historical | 3 hours | Data retained for 1 year.”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs - 7.
“In the ACCOUNT_USAGE schema, latency for the view is up to 180 minutes (3 hours), except for the CREDITS_USED_CLOUD_SERVICES column.”
↩︎ ACCOUNT_USAGE versus INFORMATION_SCHEMA“return the hourly credit usage for a single warehouse (or all the warehouses in your account) within the last 365 days (1 year)”
↩︎ ACCOUNT_USAGE versus INFORMATION_SCHEMA“you must first set the timezone of the session to UTC”
↩︎ ORGANIZATION_USAGE for cost across every account - 8.
“Latency for this view can be up to eight hours.”
↩︎ ACCOUNT_USAGE versus INFORMATION_SCHEMA - 9.
“If the time range does not fall within the last 7 days, an error is returned.”
↩︎ ACCOUNT_USAGE versus INFORMATION_SCHEMA“If END_TIME_RANGE_END is not specified, the function returns all queries, including those that are still running.”
↩︎ Prediction - 10.
“Snowflake provides historical usage data for all accounts in your organization via the ORGANIZATION_USAGE schema in a shared database named SNOWFLAKE.”
↩︎ ORGANIZATION_USAGE for cost across every account“The ORGANIZATION_USAGE schema is available in the organization account and a regular account that has the ORGADMIN role enabled.”
↩︎ ORGANIZATION_USAGE for cost across every account“The organization billing views do not display the actual, final amount because some adjustments are made at the end of the month.”
↩︎ ORGANIZATION_USAGE for cost across every account“By default, only users granted the GLOBALORGADMIN role can access ORGANIZATION_USAGE views in the organization account.”
↩︎ Exam trap 3 - 11.https://docs.snowflake.com/en/user-guide/budgetsOfficial docs
“historical data for the month is only backfilled for resources that were added to the budget using a tag”
↩︎ Budgets for warehouse and serverless spending“By default, the budget refresh interval is up to 6.5 hours.”
↩︎ Budgets for warehouse and serverless spending“A budget sends a daily alert notification when current spending is on track to exceed the spending limit based on time-series forecasting.”
↩︎ Budgets for warehouse and serverless spending“Each stored procedure you define can perform actions such as suspending warehouses, sending notifications, or logging events to a table.”
↩︎ Exam trap 1“Setting the refresh interval to one hour increases the compute cost of the budget by a factor of 12.”
↩︎ Exam trap 2“The spending limit is expressed in Snowflake credits and is used for alerting and notification purposes only.”
↩︎ Prediction - 12.
“waiting for the warehouse compute resources to provision, due to warehouse creation, resume, or resize.”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs“due to the warehouse being overloaded by the current query workload.”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs - 13.
“WAREHOUSE_LOAD_HISTORY | 14 days | Results depend on MONITOR USAGE privilege.”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs - 14.
“Status of the query, for example to identify long-running queries, failed queries, and queued queries.”
↩︎ Suspending, resuming and monitoring warehouses to optimize costs