架构:

ACCOUNT_USAGEREADER_ACCOUNT_USAGE

METERING_HISTORY 视图

ACCOUNT_USAGE 架构中的 METERING_HISTORY 视图可用于返回账户在过去 365 天(1 年)内的每小时 Credit 使用情况。

列名称

数据类型

描述

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

发生使用的日期以及起始时间(以本地时区为准)。

END_TIME

TIMESTAMP_LTZ

发生使用的日期以及结束时间(以本地时区为准)。

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:

  • 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_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

仓库、无服务器计算和 Openflow 资源在一小时内使用的 credit 数。

CREDITS_USED_CLOUD_SERVICES

NUMBER

一小时内用于云服务的 credit 数。如果 SERVICE_TYPE 是 Openflow 类型之一,则始终为 0

CREDITS_USED

NUMBER

一小时内用于账户的 Credit 总数。这是 CREDITS_USED_COMPUTE 和 CREDITS_USED_CLOUD_SERVICES 的总和。此值未考虑云服务的调整,因此可能大于实际使用的 Credit的量。

BYTES

NUMBER

当服务类型为 auto_clustering 时,表示在 START_TIME 和 END_TIME 窗口内重聚类的字节数。当服务类型为 pipe 时,表示在 START_TIME 和 END_TIME 窗口内插入的字节数。当服务类型为 SNOWPIPE_STREAMING 时,指示在 START_TIME 和 END_TIME 窗口期间迁移的字节数。当服务类型为 COPY_FILES 时,将在数据库级别聚合列。

ROWS

NUMBER

当服务类型为 auto_clustering 时,表示在 START_TIME 和 END_TIME 窗口内重聚类的行数。当服务类型为 SNOWPIPE_STREAMING 时,表示在 START_TIME 和 END_TIME 窗口内迁移的行数。

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.

使用说明

  • 此视图的延迟时间可能长达 180 分钟(3 小时),CREDITS_USED_CLOUD_SERVICES 列除外。CREDITS_USED_CLOUD_SERVICES 的延迟时间最长可达 6 小时。

  • 在显示 SNOWPIPE_STREAMING 的 Credit 用量时,延迟时间可能长达 12 小时。

语言: 中文