- Schemas:
WAREHOUSE_ METERING_ HISTORY 视图¶
此 Account Usage 视图可用于返回过去 365 天(1 年)内单个仓库(或账户中的所有仓库)的每小时 credit 使用量。
列
| Column Name | Data Type | Description |
|---|---|---|
| READER_ACCOUNT_NAME | VARCHAR | Name of the reader account where the warehouse usage took place. Column only included in view in READER_ACCOUNT_USAGE schema. |
| START_TIME | TIMESTAMP_LTZ | The date and beginning of the hour (in the local time zone) in which the warehouse usage took place. |
| END_TIME | TIMESTAMP_LTZ | The date and end of the hour (in the local time zone) in which the warehouse usage took place. |
| WAREHOUSE_ID | NUMBER | Internal/system-generated identifier for the warehouse. |
| WAREHOUSE_NAME | VARCHAR | Name of the warehouse. |
| CREDITS_USED | NUMBER | Total number of credits used for the warehouse 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 the credits that are billed. To determine how many credits were actually billed, run queries against the METERING_DAILY_HISTORY view. |
| CREDITS_USED_COMPUTE | NUMBER | Number of credits used for the warehouse in the hour. |
| CREDITS_USED_CLOUD_SERVICES | NUMBER | Number of credits used for cloud services in the hour. |
| CREDITS_ATTRIBUTED_COMPUTE_QUERIES | NUMBER | Number of credits attributed to queries in the hour. Includes only the credit usage for query execution and doesn’t include warehouse idle time usage. |
使用说明
-
In the ACCOUNT_USAGE schema, latency for the view is up to 180 minutes (3 hours), except for the CREDITS_USED_CLOUD_SERVICES column. Latency for CREDITS_USED_CLOUD_SERVICES is up to 6 hours.
-
在 READER_ACCOUNT_USAGE 架构中,视图的延迟时间最长可达 24 小时。
-
仓库闲置时间不包括在 CREDITS_ATTRIBUTED_COMPUTE_QUERIES 列中。
See Examples for a query that calculates the cost of idle time.
- The
CREDITS_ATTRIBUTED_COMPUTE_QUERIEScolumn is NULL for adaptive warehouses. -
If you want to reconcile the data in this view with a corresponding view in the ORGANIZATION USAGE schema, you must first set the timezone of the session to UTC. Before querying the Account Usage view, execute:
示例
例如,要确定过去 10 天内每个仓库的空闲时间成本,请执行以下语句: