- Schema:
METERING_ HISTORY view¶
Important
This view is only available in the organization account. For more information, see Premium views in the organization account.
The METERING_HISTORY view in the ORGANIZATION_USAGE schema can be used to return the hourly credit usage for each account in the organization.
Columns¶
Organization-level columns
| Column Name | Data Type | Description |
|---|---|---|
| ORGANIZATION_NAME | VARCHAR | Name of the organization. |
| ACCOUNT_LOCATOR | VARCHAR | System-generated identifier for the account. |
| ACCOUNT_NAME | VARCHAR | User-defined identifier for the account. |
Additional 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. If the SERVICE_TYPE is an Openflow type, the value is NULL. 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. |
| 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 Types: The value is NULL. |
| 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 24 hours.