Understanding costs for dynamic tables

このトピックでは、動的テーブルに関連する計算コストとストレージコストの概要を説明します。Snowflakeコストに関する一般的な情報については、 総コストについて をご参照ください。

Compute costs

動的テーブルには、仮想ウェアハウスとクラウドサービスのコンピューティングという2つのコンピューティングコストがあります。

Dynamic tables require at least one virtual warehouse to perform refreshes. You can optionally assign a second warehouse if you want to separate compute costs for different operations. For more information, see Understand warehouse usage for dynamic tables.

Dynamic table refreshes consume compute credits, and their frequency is determined by the configured target lag: lower target lag values trigger more frequent refreshes and therefore higher compute costs.

Dynamic tables also require Cloud Services compute to identify changes in underlying base objects and determine whether a virtual warehouse must run. If Cloud Services compute finds no changes, no warehouse compute credits are consumed because there's no new data to refresh. If changes do exist, even if the dynamic table query filters them, the virtual warehouse consumes credits because the dynamic table refreshes to evaluate whether those changes apply.

If the associated virtual warehouses are suspended and Cloud Services compute detects no changes in the base tables, the warehouses remain suspended and the dynamic tables don't consume any credits. When Cloud Services compute identifies changes in the base tables, the appropriate warehouse automatically resumes. If the changes support incremental refresh, the dynamic table refreshes by using the WAREHOUSE parameter. If reinitialization is required --- for example, because of a base table schema change --- the dynamic table uses the INITIALIZATION_WAREHOUSE to perform a full reinitialization. For information on how dynamic tables automatically suspend, see 自動動的テーブル一時停止.

Check your consumption of virtual warehouse credits

To check whether your dynamic table refreshes consumed virtual warehouse credits, use the Refresh History tab in Snowsight:

  1. ナビゲーションメニューで Transformation » Dynamic tables を選択します。

  2. Select your dynamic table, and then select the Refresh History tab.

  3. To view refreshes that used the warehouse to update, select the Warehouse used only checkbox.

Tip

To better understand costs related to your dynamic table pipelines, Snowflake recommends that you test dynamic tables by using dedicated warehouses. This way, you can isolate the virtual warehouse consumption that is attributed to dynamic tables. You can move your dynamic tables to a shared warehouse after you establish a cost baseline.

For more information, see Understand warehouse usage for dynamic tables.

不変性制約のコンピューティングコスト

If you use the IMMUTABLE WHERE constraint, Snowflake recomputes only the rows that don’t match the immutability condition, which helps reduce reinitialization costs. This is useful in situations where reinitialization can occur, such as the following scenarios:

  • 上流のテーブルまたはビューの再作成。

  • 上流のデータガバナンスポリシーの変更。

  • フェールオーバーグループ内のセカンダリリージョンへのフェールオーバー。

Using the IMMUTABLE WHERE constraint can help you reduce the cost of incremental and full refresh because the constraint ignores changes and data that match its predicate.

Adding immutability constraints to a dynamic table doesn’t trigger extra computation, but removing them does because it causes reinitialization on the next refresh. Modifying the predicate in an IMMUTABLE WHERE constraint might trigger reinitialization depending on whether Snowflake can determine the rows that are returned with the original condition are still returned with the new condition.

たとえば、以下の変更は再初期化をトリガーしません。

  • (ts < CURRENT_TIMESTAMP() - INTERVAL 「2日」) から (ts < CURRENT_TIMESTAMP() - INTERVAL 「1日」) まで

  • (年<= 2023) から (年<= 2024) まで

以下の変更は再初期化をトリガーします。

  • (ts < '2025-01-02') から (ts < '2025-01-01') まで

  • (年<2024年) から (月< 10) まで

ストレージコスト

Dynamic tables require storage to store the materialized results. Similar to regular tables, you might incur additional storage cost for Time Travel, fail-safe storage, and cloning features.

Dynamic Apache Iceberg™ tables don't incur Snowflake storage costs. For more information, see 請求.

このセクションでは、動的テーブルのストレージに関する以下の考慮事項について説明します。

このストレージがどのようにコストを発生させるかについての詳細については、 ストレージコストについて および データストレージに関する考慮事項 をご参照ください。

Time TravelおよびFail-safeストレージ

With Snowflake Time Travel, you can access and query historical versions of dynamic tables at specific points in time, which can help provide insights into historical trends, changes, and anomalies in your data.

Frequent refreshes can increase buildup of Time Travel data, which adds to your overall storage usage. For more information, see Time Travelの理解と使用.

Fail-safe機能により、動的テーブルをデータの損失や破損から保護します。設定されたFail-safe期間に応じて、追加の保管料が発生する場合があります。

動的テーブルの複製

Dynamic tables support cross-account, cross-region replication, which lets you copy data from a primary database to a secondary database for either disaster recovery or data sharing. It can serve as either a failover preparation strategy for disaster recovery or as a means of sharing data across deployments for read-only purposes. Using replication with dynamic tables is subject to replication costs. For more information, see 複製と動的テーブル.

中断された動的テーブル

Suspended dynamic tables don't incur additional costs beyond standard storage fees and don't consume compute resources. If you have ongoing maintenance tasks or scheduled jobs that interact with the suspended table, your dynamic tables might consume compute resources.

一時動的テーブル

Snowflake supports transient dynamic tables, similar to regular tables, that persist until explicitly dropped, and are available to all users with the appropriate privileges without a fail-safe period. Transient dynamic tables are best used for transitory data that doesn't need the same level of data protection and recovery that permanent tables provide. Using them helps you save on storage charges for fail-safe storage.

増分リフレッシュ操作のための追加ストレージ

For incremental refresh operations, dynamic tables maintain an additional internal metadata column for identifying each row within the table. Internal row identifiers consume a constant amount of storage per row and increase storage cost linearly to the number of rows in the table, independent of the number of columns.

For tables with very few columns, the increase in storage compared to an equivalent CTAS table can be significant, or even dominant. In wider dynamic tables, this effect is less pronounced.

リフレッシュスケジュールコスト

The schedule at which a dynamic table refreshes, whether full or incremental, has an effect on its overall cost. This section discusses the factors that you should consider when you decide on a refresh schedule, with the assumption that every refresh is non-empty:

注釈

ソースが変わっていなければ、リフレッシュは比較的安価です。詳細については、 Compute costs (このトピック内)をご参照ください。

フルリフレッシュスケジュール

The cost of a full refresh typically depends on how much data your dynamic table scans and how often it refreshes. To save on costs, you can refresh your dynamic tables only when you need to; for example, you can suspend your dynamic tables outside of business hours. For precise timing control, set the downstream target lag for your dynamic tables and use manual refresh from a task to automate your custom schedules.

増分リフレッシュスケジュール

The cost of an incremental refresh is typically proportional to the volume of changes in the source objects, plus some fixed overhead.

If the overhead is low, you can set a high refresh frequency without much downside. This means that you can refresh often for best results. For instance, a simple SELECT ... FROM ... WHERE dynamic table only processes changed rows between refreshes, which has minimal overhead and the dynamic table can run frequently at low added cost.

If the overhead is high, you must balance the credit consumption of high refresh frequency with the business benefits of freshness. For example, in a dynamic table with a join, you must join the changes in one table with the other table. No matter how small the set of changes, this join usually involves a minimum cost for you to execute. If this overhead is significant, it can accumulate as the refresh frequency increases.