- Schemas:
METERING_ HISTORY view¶
The METERING_HISTORY view in the ACCOUNT_USAGE schema can be used to return the hourly credit usage for an account within the last 365 days (1 year).
Columns¶
| Column Name | Data Type | Description |
|---|---|---|
| SERVICE_TYPE | VARCHAR | Type of service that is consuming credits. The following list includes many, but not all, of the possible service types:
|
| START_TIME | TIMESTAMP_LTZ | The date and beginning of the hour (in the local time zone) in which the usage took place. |
| END_TIME | TIMESTAMP_LTZ | The date and end of the hour (in the local time zone) in which the usage took place. |
| ENTITY_ID | NUMBER | A system-generated identifier for the entity associated with the service. In most cases, this is the internal ID of the monitored entity; for example, a pipe, task, or replication group. When the SERVICE_TYPE is COPY_FILES, this column shows the ID of the database, schema, or stage from which files are copied. When the SERVICE_TYPE is OPENFLOW_COMPUTE_SNOWFLAKE, this column shows the ID of the compute pool that incurred the cost. When the SERVICE_TYPE is OPENFLOW_COMPUTE_BYOC, the value is the ID of the Openflow runtime (gen 2) or integration (gen 1) that incurred the cost. The value is NULL when Snowflake doesn’t know the entity, such as for usage recorded before entity attribution was turned on for your account. If the SERVICE_TYPE is Snowpipe Streaming, this shows the ID of the relevant pipe; which is the default pipe ID for the default pipe. |
| ENTITY_TYPE | VARCHAR | Type of Snowflake resource that consumed credits, such as WAREHOUSE, TASK, or TABLE. Note that TABLE is used for all table-like objects. When the SERVICE_TYPE is OPENFLOW_COMPUTE_BYOC, the value is |
| NAME | VARCHAR | The name of the service or object associated with the cost entry, which varies significantly based on the SERVICE_TYPE. Standard (General): This column shows the name of the service type itself; for example, REPLICATION, TASK. SNOWPIPE_STREAMING: This service type generates two distinct cost entries, and the NAME column varies for each:
COPY_FILES: The value is the name of the database from which the files are copied. OPENFLOW_COMPUTE_SNOWFLAKE: The name of the compute pool that incurred the cost. See Compute pool naming and per-deployment attribution for how these names are constructed. OPENFLOW_COMPUTE_BYOC: The name of the Openflow runtime that incurred the cost. |
| DATABASE_ID | NUMBER | Internal/system-generated identifier of the database associated with the resource of type ENTITY_TYPE. Contains a NULL value when the resource isn’t associated with a specific database; for example, a warehouse or compute pool. |
| DATABASE_NAME | VARCHAR | Name of the database associated with the resource of type ENTITY_TYPE. Contains a NULL value when the resource isn’t associated with a specific database. |
| SCHEMA_ID | NUMBER | Internal or system-generated identifier of the schema associated with the resource of type ENTITY_TYPE. Contains a NULL value when the resource isn’t associated with a specific schema. |
| SCHEMA_NAME | VARCHAR | Name of the schema associated with the resource of type ENTITY_TYPE. Contains a NULL value when the resource isn’t associated with a specific schema. |
| CREDITS_USED_COMPUTE | NUMBER | Number of credits used by warehouses, serverless compute, and Openflow resources in the hour. |
CREDITS_USED_CLOUD_ SERVICES | NUMBER | Number of credits used for cloud services in the hour. Always 0 when the SERVICE_TYPE is one of the Openflow types. |
| CREDITS_USED | NUMBER | Total number of credits used for the account in the hour. This is a sum of CREDITS_USED_COMPUTE and CREDITS_USED_CLOUD_SERVICES. This value does not take into account the adjustment for cloud services, and may therefore be greater than your actual credit consumption. |
| BYTES | NUMBER | When the service type is auto_clustering, indicates the number of bytes reclustered during the START_TIME and END_TIME window. When the service type is pipe, indicates the number of bytes inserted during the START_TIME and END_TIME window. When the service type is SNOWPIPE_STREAMING, indicates the number of bytes migrated during the START_TIME and END_TIME window. When the service type is COPY_FILES, columns are aggregated at the database level. |
| ROWS | NUMBER | When the service type is auto_clustering, indicates number of rows reclustered during the START_TIME and END_TIME window. When the service type is SNOWPIPE_STREAMING, indicates the number of rows migrated during the START_TIME and END_TIME window. |
| FILES | NUMBER | When the service type is pipe, indicates number of files loaded during the START_TIME and END_TIME window. When the service type is SNOWPIPE_STREAMING, this is NULL. When the service type is COPY_FILES, columns are aggregated at the database level. |
Usage notes¶
- Latency for the view may be up to 180 minutes (3 hours), except for the CREDITS_USED_CLOUD_SERVICES column. Latency for CREDITS_USED_CLOUD_SERVICES may be up to 6 hours.
- Latency for showing the credit consumption of
SNOWPIPE_STREAMINGmay be up to 12 hours.