Schema:

ORGANIZATION_USAGE

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 NameData TypeDescription
ORGANIZATION_NAMEVARCHARName of the organization.
ACCOUNT_LOCATORVARCHARSystem-generated identifier for the account.
ACCOUNT_NAMEVARCHARUser-defined identifier for the account.

Additional columns

Column NameData TypeDescription
SERVICE_TYPEVARCHAR

Type of service that is consuming credits. The following list includes many, but not all, of the possible service types:

START_TIMETIMESTAMP_LTZThe date and beginning of the hour (in the local time zone) in which the usage took place.
END_TIMETIMESTAMP_LTZThe date and end of the hour (in the local time zone) in which the usage took place.
ENTITY_IDNUMBER

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_TYPEVARCHARType of Snowflake resource that consumed credits, such as WAREHOUSE, TASK, or TABLE. Note that TABLE is used for all table-like objects.
NAMEVARCHAR

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:

  • Cost entry 1 (table name): The value is the name of the Snowflake target table. For the high-performance default pipe, the name is derived from the target table name and appended with -STREAMING; for example, MY_TABLE-STREAMING.
  • Cost entry 2 (client string): The value is a colon-separated string in the format: SNOWPIPE_STREAMING:CLIENT_NAME:SNOWFLAKE_PROVIDED_ID. This is used for tracking client-side costs.

COPY_FILES: The value is the name of the database from which the files are copied.

Openflow Types: The value is NULL.

DATABASE_IDNUMBERInternal/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_NAMEVARCHARName 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_IDNUMBERInternal 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_NAMEVARCHARName 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_COMPUTENUMBERNumber of credits used by warehouses, serverless compute, and Openflow resources in the hour.

CREDITS_USED_CLOUD_ SERVICES

NUMBERNumber of credits used for cloud services in the hour. Always 0 when the SERVICE_TYPE is one of the Openflow types.
CREDITS_USEDNUMBERTotal 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.
BYTESNUMBERWhen 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.
ROWSNUMBERWhen 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.
FILESNUMBERWhen 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.