Course contents

SnowPro Core COF-C03 Study GuidePart 2: Warehouses and performanceCost Visibility

Cost Visibility

Cost Visibility

A monthly bill with no breakdown is useless for chargeback and useless for catching a runaway pipeline. This page is entirely about closing that gap: which views hold the numbers, which one to reach for depending on how fresh or how far back you need to look, and the query shape that answers "who spent what."

Where the cost data lives

Snowflake ships the audit trail with the product: the SNOWFLAKE database (a share from Snowflake itself) exposes ACCOUNT_USAGE views that break every credit and byte down by source. The ones worth knowing by name:

View (SNOWFLAKE.ACCOUNT_USAGE)Answers
WAREHOUSE_METERING_HISTORYCredits per warehouse per hour: the chargeback backbone
METERING_DAILY_HISTORYDaily credits by service type: warehouses vs each serverless feature vs cloud services
AUTOMATIC_CLUSTERING_HISTORYWhat each clustered table spent on reclustering
MATERIALIZED_VIEW_REFRESH_HISTORYWhat each MV spent staying fresh
SEARCH_OPTIMIZATION_HISTORYWhat SOS maintenance cost per table
PIPE_USAGE_HISTORYSnowpipe credits and bytes per pipe
QUERY_ACCELERATION_ELIGIBLEWhich past queries would have benefited from QAS, before you pay for it
TABLE_STORAGE_METRICSActive vs Time Travel vs Fail-safe bytes per table: where storage money hides
QUERY_HISTORY365 days of every statement, with spill, scan, and queue columns for workload forensics

All of them lag up to a few hours but keep a year of history; the INFORMATION_SCHEMA table functions are the zero-latency, short-retention counterparts for "right now" questions.

Who can actually query these views

By default, nobody but ACCOUNTADMIN. The SNOWFLAKE database is a share, imported from Snowflake itself, and shared databases don't accept ordinary object grants; access is opened one of two ways. The classic grant hands over everything in the database at once. The newer, finer path grants one of the built-in SNOWFLAKE database roles, each scoping a family of views: USAGE_VIEWER for most of the cost and metering views on this page, and its siblings GOVERNANCE_VIEWER (access history, policies, and also QUERY_HISTORY and QUERY_ACCELERATION_ELIGIBLE), SECURITY_VIEWER (grants, login history), and OBJECT_VIEWER (object metadata).

-- Classic: everything in the SNOWFLAKE database, all at once
GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE finops;

-- Finer-grained: just the usage and cost views
GRANT DATABASE ROLE SNOWFLAKE.USAGE_VIEWER TO ROLE finops;

One adjacent privilege completes the picture: the account-level MONITOR USAGE privilege lets a role see the Snowsight cost dashboards and run SHOW commands across objects it doesn't own, without granting any table access. A requirement like "a FinOps role must query WAREHOUSE_METERING_HISTORY without ACCOUNTADMIN" calls for IMPORTED PRIVILEGES or USAGE_VIEWER, and "shared databases can't be granted object by object" is why.

Three sources of cost and usage data, nested by scope. INFORMATION_SCHEMA table functions cover one database, in real time, with 7 days to 6 months of history depending on the function. SNOWFLAKE.ACCOUNT_USAGE views cover the whole account with 365 days of history and 45 minutes to 3 hours of latency. SNOWFLAKE.ORGANIZATION_USAGE covers every account in the organization.SNOWFLAKE.ORGANIZATION_USAGESNOWFLAKE.ACCOUNT_USAGEINFORMATION_SCHEMATABLE FUNCTIONSOne databasereal time, no lag7 days to 6 months ofhistory, by functionVIEWSWhole account365 days of history45 min to 3 h lagVIEWSEvery accountin theorganization

SNOWFLAKE.ORGANIZATION_USAGE

SNOWFLAKE.ACCOUNT_USAGE

INFORMATION_SCHEMA

TABLE FUNCTIONSOne databasereal time, no lag7 days to 6 months of history, by function

VIEWSWhole account365 days of history45 min to 3 h lag

VIEWSEvery accountin the organization

Figure 2.9 Pick the source by scope and history. Each box sits inside a wider scope: INFORMATION_SCHEMA table functions answer "right now" questions for one database; ACCOUNT_USAGE keeps a year for the whole account at the price of some latency; ORGANIZATION_USAGE spans every account in the organization.

Two sources, one distinction. The INFORMATION_SCHEMA in each database has table functions like WAREHOUSE_METERING_HISTORY with near real-time data but short retention (7 days to 6 months depending on the function). The SNOWFLAKE.ACCOUNT_USAGE schema has views with 365 days of retention but latency, typically 45 minutes to 3 hours depending on the view. Real-time troubleshooting: INFORMATION_SCHEMA. Historical analysis and chargeback: ACCOUNT_USAGE. Org-wide, across accounts: ORGANIZATION_USAGE, readable via ORGADMIN.

-- Credits by warehouse, last 30 days (ACCOUNT_USAGE: 365d retention, some latency)
SELECT warehouse_name, SUM(credits_used) AS credits
FROM snowflake.account_usage.warehouse_metering_history
WHERE start_time >= DATEADD('day', -30, CURRENT_TIMESTAMP())
GROUP BY 1 ORDER BY 2 DESC;
Key takeaways
  • Resource monitors watch warehouse credits and can suspend warehouses. Budgets also watch serverless and AI spend; they notify and can run custom actions, but have no built-in suspend.
  • INFORMATION_SCHEMA = fresh but short-lived. ACCOUNT_USAGE = 365 days but latent. ORGANIZATION_USAGE = all accounts in the org.