Snowpipe 成本¶
借助 Snowpipe 的无服务器计算模型,用户可以启动任何大小的负载,而无需管理虚拟仓库。相反,Snowflake 提供并管理计算资源,根据当前的 Snowpipe 负载自动增加或缩小容量。
重要
Snowpipe 数据引入按每 GB 固定积分数量计费。这种简化的模型为您提供了更加可预测的数据加载费用,并简化了成本估算。之前的计费模型包含两个部分:用于加载数据的实际计算资源(按每秒/每核心计费),以及每 1,000 个文件收取的费用。
这种按每 GB Credit 计费的模型适用于所有 Snowflake 版本:Standard、Enterprise、Business Critical 和 Virtual Private Snowflake (VPS)。
对于文本文件(例如 CSV、JSON、XML),您需要根据其未压缩的大小付费。对于二进制文件(例如 Parquet、Avro、ORC),无论是否经过压缩,您都将根据其实际观测大小付费。
有关更多信息,请参阅 Snowflake 服务使用量表。
资源使用和管理开销¶
在按每 GB Credit 的定价模型下,Snowpipe 的计费基于您加载的每 GB 数据所对应的固定积分数量。这种简化的方式意味着您无需再跟踪或管理计算资源的使用情况,而此前该使用情况是以每秒/每核心的粒度进行计量的。
File sizes and staging frequency might impact the performance of Snowpipe. For recommended best practices, see 连续数据加载 – 即 Snowpipe – 和文件大小调整.
估计 Snowpipe 费用¶
Estimating Snowpipe charges is straightforward. You can calculate your expected costs by using your anticipated data volume and the fixed credit amount per GB. Because text files --- such as CSV, JSON, XML --- are charged based on their uncompressed size, you must know the compression ratio of your text files.
然后,您可以通过检查相关 Account Usage 视图中的 BILLED_BYTES 列,对照实际使用情况验证这些计算结果。BILLED_BYTES 列是在 2025_05 BCR 捆绑包 中引入的。
To understand the actual credit consumption for your specific workloads, we suggest that you experiment by performing a typical set of loads.
查看数据加载历史记录和成本¶
Account administrators (users with the ACCOUNTADMIN role) or users with a role granted the MONITOR USAGE global privilege can use Snowsight or SQL to view the credits billed to your Snowflake account within a specified date range.
偶尔,数据压缩和维护过程会消耗 Snowflake Credit。例如,返回的结果可能显示您使用了 0 BYTES_INSERTED 和 0 FILES_INSERTED 的 Credit。这表示您的数据未加载,但数据压缩和维护过程已使用了一些 Credit。
要查看您账户中 Snowpipe 数据加载的 Credit 账单,请执行以下操作:
- Snowsight:
In the navigation menu, select Admin » Cost management.
- SQL:
查询以下任一内容:
/sql-reference/account-usage/pipe_usage_history`(在 :doc:/sql-reference/account-usage` 中)。
You can run the following queries against the PIPE_USAGE_HISTORY view. You can verify costs based on volume by using the
BYTES_BILLEDcolumn.查询:Snowpipe 成本历史记录(按天、按对象)
The following query provides a full list of pipes and the volume of credits that you consumed through the service over the last 30 days, broken out by day.
SELECT TO_DATE(start_time) AS date, pipe_name, SUM(credits_used) AS credits_used, SUM(bytes_billed) AS bytes_billed_total FROM snowflake.account_usage.pipe_usage_history WHERE start_time >= DATEADD(month,-1,CURRENT_TIMESTAMP()) GROUP BY 1,2 ORDER BY bytes_billed_total DESC;查询:Snowpipe 历史记录和 m 天平均值
以下查询显示了去年按周分组的 Snowpipe 平均每日使用的 Credit。此查询可以帮助您识别一年中每日平均使用量的异常情况,以便您可以调查使用量的突然增长或意外变化。
WITH credits_by_day AS ( SELECT TO_DATE(start_time) AS date, SUM(credits_used) AS credits_used, SUM(bytes_billed) AS bytes_billed_total FROM snowflake.account_usage.pipe_usage_history WHERE start_time >= DATEADD(year,-1,CURRENT_TIMESTAMP()) GROUP BY 1 ) SELECT DATE_TRUNC('week',date), AVG(credits_used) AS avg_daily_credits, AVG(bytes_billed_total) AS avg_daily_bytes_billed FROM credits_by_day GROUP BY 1 ORDER BY 1;
备注
资源监视器 提供对虚拟仓库 Credit 使用量的控制;但是,您不能使用它们来控制 Snowflake 提供的仓库的 Credit 使用量,包括
SNOWPIPE 仓库。