
Snowflake cost per query estimates the warehouse compute assigned to a statement and multiplies it by the account's credit rate.
QUERY_ATTRIBUTION_HISTORY reports compute cost assigned to individual queries. Join it to QUERY_HISTORY to add the user, role, warehouse, and query text. The resulting figure covers warehouse compute assigned to the query, not every account charge.
Serverless features, storage, data transfer, and Cloud Services can be billed separately. A query that calls Cortex, for example, can create an AI service charge in addition to warehouse compute.
If a query uses 0.25 credits and the account rate is $3 per credit, the warehouse portion is $0.75. The exact amount depends on the attribution record and the rate in the account agreement.
Aggregate cost per query by user, role, warehouse, team tag, or query tag. Compare the cost with runtime and business frequency. A high-cost query that runs once may matter less than a low-cost query that runs thousands of times.
Snowflake documents query attribution and the QUERY_ATTRIBUTION_HISTORY view.