WAREHOUSE_METERING_HISTORY view (ACCOUNT_USAGE): New column (Pending)¶
Attention
This behavior change is in the 2024_08 bundle.
For the current status of the bundle, refer to Bundle History.
When this behavior change bundle is enabled, the Account Usage WAREHOUSE_METERING_HISTORY view includes the following new column:
Column name |
Data type |
Description |
---|---|---|
CREDITS_ATTRIBUTED_COMPUTE_QUERIES |
NUMBER |
Number of credits attributed to queries in the hour. Includes only the credit usage for query execution and doesn’t include usage for any warehouse idle time. |
Usage notes¶
Latency for this column might be up to six hours.
Warehouse idle time is not included in the CREDITS_ATTRIBUTED_COMPUTE_QUERIES column. See Examples for a query that calculates the cost of idle time.
Examples¶
For example, to determine the cost of idle time for each warehouse for the last 10 days, execute the following statement:
SELECT (
SUM(credits_used_compute) -
SUM(credits_attributed_compute_queries)
) AS idle_cost,
warehouse_name
FROM SNOWFLAKE.ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY
WHERE start_time >= DATEADD('days', -10, CURRENT_DATE())
AND end_time < CURRENT_DATE()
GROUP BY warehouse_name;
Ref: 1714