WAREHOUSE_METERING_HISTORY

functionsupportedAccounts, users, sessions, warehouses

docs.snowflake.com ↗

Information SchemaTable functions

This table function can be used in queries to return the hourly credit usage for a single warehouse (or all the warehouses in your account) within a specified date range. Note This function is generally deprecated in favor of the ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY view, which provides a more complete data set and supports longer date ranges. Note This function does not include credit usage for Adaptive Warehouses. To view Adaptive Warehouse usage, use the ACCOUNT_USAGE.WAREHOUSE_METERING_HISTORY view.

Syntax

supportedpartialnot supportednot scored

WAREHOUSE_METERING_HISTORY(
      DATE_RANGE_START => <constant_expr>
      [ , DATE_RANGE_END => <constant_expr> ]
      [ , WAREHOUSE_NAME => '<string>' ] )

Parameters

NameRequiredDescription
DATE_RANGE_START => constant_exprrequiredThe starting date, within the last 6 months, for which warehouse usage is returned.
DATE_RANGE_END => constant_exproptionalThe ending date, within the last 6 months, for which warehouse usage is returned. Default: CURRENT_DATE is used.
WAREHOUSE_NAME => 'string'optionalThe name of the warehouse to retrieve credit usage for. Note that the warehouse name must be enclosed in single quotes. Also, if the warehouse name any spaces, mixed-case characters, or special characters, the name must be double-quoted within the single quotes (e.g. '"My Warehouse"' vs 'mywarehouse'). Default: All warehouses that ran during the specified date range.

Usage notes

Output

The function returns the following columns, ordered by WAREHOUSE_NAME and START_TIME: Column Name | Data Type | Description START_TIME | TIMESTAMP_LTZ | The beginning of the hour in which this warehouse usage took place. END_TIME | TIMESTAMP_LTZ | The end of the hour in which this warehouse usage took place. WAREHOUSE_NAME | VARCHAR | Name of the warehouse. CREDITS_USED | NUMBER | Number of credits billed for this warehouse in this hour. CREDITS_USED_COMPUTE | NUMBER | Number of credits used for the warehouse in the hour. CREDITS_USED_CLOUD_SERVICES | NUMBER | Number of credits used for cloud services in the hour.

See also

Referenced by