架构:

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

Internal/system-generated identifier for the entity type. When the service type is COPY_FILES, this column shows the ID of the database, schema, or stage from which files are copied. NULL when the SERVICE_TYPE is one of the Openflow types.

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

Name of the service type. When the service type is SNOWPIPE_STREAMING, there are two cost entries. One entry is for the name of the Snowflake Table object and the other one is for the colon-separated Snowpipe Streaming, CLIENT_NAME and SNOWFLAKE_PROVIDED_ID. When the service type is COPY_FILES, this column shows the name of the database from which files are copied. When the service type is one of the Openflow types, the column shows 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/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

当服务类型为 pipe 时,表示在 START_TIME 和 END_TIME 窗口内加载的文件数。当服务类型为 SNOWPIPE_STREAMING 时,此值为 null。当服务类型为 COPY_FILES 时,将在数据库级别聚合列。

使用说明

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

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

语言: 中文