存储生命周期策略计费

备注

存储生命周期策略 目前在政府区域不可用。

使用存储生命周期策略时,会产生策略执行、数据存储和数据操作的成本。本主题介绍与存储生命周期策略相关的成本组成部分,并提供有关如何监控每个组成部分的指导。

策略执行成本

每次 Snowflake 运行存储生命周期策略时,都会产生无服务器计算费用,以识别和处理满足定义条件的行。策略会自动运行,大约每 24 小时运行一次。有关计费详细信息,请参阅 Snowflake 服务使用量表 中的表 5。

监控

To view credits that are consumed by policy execution, use the following metering history views. Filter for the STORAGE_LIFECYCLE_POLICY_EXECUTION service type:

要查看策略执行历史记录和元数据,请使用以下视图和函数:

备注

即使处理的数据量相似,策略执行时间也可能因执行而异。为了更好地了解策略执行成本,请监控每次执行收取的 Credit 以及过期或归档的数据量。

归档存储成本

归档数据时,您需要支付以下费用:将数据移动到归档存储的费用、将数据存储在归档存储中的费用以及检索归档数据的费用。如果删除包含归档数据的表,还可能会产生最低存储期限费用。

将数据移动到归档存储

当策略执行数据归档时,会产生一次性无服务器计算费用,将数据从常规存储迁移到冷/极冷归档存储层。有关计费详细信息,请参阅 Snowflake 服务使用量表 中的表 5。

监控

To view the credits consumed to move data to archive storage, use the following metering history views. Filter for the STORAGE_LIFECYCLE_POLICY_EXECUTION and ARCHIVE_STORAGE_WRITE service types:

数据存储

After policy execution, you temporarily incur charges for both archive storage and table storage. Snowflake immediately copies data into the specified archive storage tier when the policy runs. However, the data remains in table storage for seven or more days, which is the 7-day Fail-safe period plus your Time Travel retention period set by DATA_RETENTION_TIME_IN_DAYS.

在此期限之后,归档存储中的数据会产生持续的存储费用。有关计费详细信息,请参阅 Snowflake 服务使用量表 中的表 3(e)。

监控

要查看表、数据库或账户的归档数据量(以字节为单位),请使用以下视图:

Account Usage 视图:

Organization Usage 视图:

数据检索

当您查询 检索归档数据 时,您需要支付以下费用:

  • Retrieval cost: One-time charge to retrieve archived data from the archive storage tier.

  • File processing: Serverless compute charge to process the retrieved data.

  • **临时存储**(仅限 COLD 层):当您从 COLD 层中检索数据时,Snowflake 会将检索到的数据临时存储在常规存储中。这会产生额外的存储费用。

有关计费详细信息,请参阅 Snowflake 服务使用量表 中的表 4(f) 和表 5。

备注

要估算检索成本,请将 EXPLAINCREATE TABLE ... FROM ARCHIVE OF 结合使用。这会显示将从归档存储中检索的文件数。有关示例,请参阅 Retrieve archived data

监控

To view consumed credits and the cost related to retrieving archived data, use the following views:

To view the credits consumed for file processing in order to retrieve archived data, use the following metering history views. Filter for the ARCHIVE_STORAGE_RETRIEVAL_FILE_PROCESSING service type:

To view temporary storage that you use when you retreive data from the COLD storage tier, use the ARCHIVE_STORAGE_RETRIEVAL_TEMP_BYTES column in the ACCOUNT_USAGE.STORAGE_USAGE.

最短存储期限费用

云提供商对归档存储层规定了最短存储期限。删除表时,Snowflake 会从存储中删除表数据。如果表数据位于归档存储中,并且在云提供商设置的最短期限内没有存储,Snowflake 会按最短期限向您收费。

For example, if you drop a table with data that Snowflake moved to the AWS cold storage tier 15 days ago, you still incur storage cost for the remaining 165 days of the minimum cold storage period, which is the 180-day minimum minus 15 days already stored.

有关归档存储计费详细信息,请参阅 Snowflake 服务使用量表 中的表 3(e)。

最短存储期限因云提供商和存储层而异:

  • AWS 冷层:最短 90 天

  • AWS 极冷层:至少 180 天

监控

To view the amount of data that is subject to minimum storage duration charges for a table, use the following columns in the TABLE_STORAGE_METRICS view:

  • ARCHIVE_STORAGE_COOL_EARLY_DELETION_PENALTY_BYTES

  • ARCHIVE_STORAGE_COLD_EARLY_DELETION_PENALTY_BYTES

These columns are available in the following topics:

语言: 中文