Snowflake Dynamic Tables for Marketing Audiences: Incremental Refresh Patterns

A Snowflake dynamic table can keep a marketing audience current without a hand-built pipeline, but the refresh mode decides what that costs. Use ADAPTIVE for audiences fed by append-heavy tables that sometimes receive bulk loads, and FULL where incremental refresh isn't supported. Set the mode explicitly, and treat target lag as a freshness limit rather than a schedule.

Key Takeaways

  • Set the refresh mode explicitly: ADAPTIVE for append-heavy audiences with occasional bulk loads, FULL where incremental refresh isn't supported.
  • Target lag is a best-effort staleness limit with a minimum of 60 seconds, not a refresh schedule.
  • A table set to TARGET_LAG = DOWNSTREAM with no downstream dynamic tables never refreshes automatically.
  • An overwrite on an upstream table looks like a change to every row, on Snowflake and on Databricks.
  • Agree the upstream write pattern, and who owns the lag and the refresh mode, before the build starts.

Audience tables feed activation, so a stale or expensive one shows up in campaigns and on the warehouse bill. This post covers the refresh decisions that matter for that job, based on Snowflake's current documentation, with one comparison to Databricks. Refresh behaviour has changed between releases (new tables created with AUTO now resolve to ADAPTIVE rather than INCREMENTAL), so check the current documentation before you build.

Audience tables hold personal data. Agree the design with your security and privacy team before anything goes live.

What does a dynamic table do for a marketing audience?

An audience is a query: customers who match some conditions across customer, order and event tables. A dynamic table stores the result of that query, and Snowflake keeps it refreshed against a target lag you set. The messaging or advertising sync then reads a plain table instead of running the query each time.

If your audiences already live in the warehouse, our guide to when a warehouse-native CDP fits covers the wider decision. Every dynamic table has a refresh mode that controls how its contents are refreshed. Get that setting right first, because it is fixed at creation time and changing it means recreating the table.

How should you set target lag on an audience table?

Target lag is a staleness limit. With a lag of 10 minutes, Snowflake schedules refreshes so that data is at most 10 minutes old, and the gap between refreshes can vary. Snowflake treats the target as best effort, so actual lag can exceed it when warehouse size, data volume, query complexity or pipeline depth limit throughput.

The minimum target lag is 60 seconds. Build your sync to cope with data that arrives later than the target, and monitor actual lag against it. Our post on handling failed syncs covers alerting and replays for that case.

Set the lag from what the destination can consume. If the sync into your messaging tool runs hourly, a lag far below an hour only adds refresh cost, which belongs in your martech total cost of ownership count. Pick the longest lag the campaign can tolerate.

TARGET_LAG = DOWNSTREAM tells a table to refresh only when a dynamic table that reads from it needs fresh data. That suits the intermediate tables in a pipeline.

It is a trap on the table your sync reads. A table set to DOWNSTREAM with no downstream consumers never refreshes automatically, and Snowflake gives no warning. The documentation defines a downstream table as a dynamic table that depends on this one, so an external sync doesn't qualify.

Which refresh mode suits which audience?

Snowflake offers four managed modes: ADAPTIVE, FULL, INCREMENTAL and AUTO. Its guidance is to use ADAPTIVE as the preferred mode for all incremental workloads. The table maps the modes onto audience types you are likely to build.

Audience typeModeReason
Abandoned basket or recent activity, built from append-heavy event tablesADAPTIVESmall change volumes suit incremental refresh, and it reinitialises if a bulk load lands
Simple filter on a stable table with few changesINCREMENTALLowest cost per refresh, and creation fails at once if a construct is unsupported
Suppression audience built with EXCEPTFULLEXCEPT isn't supported for incremental refresh
Audience based on a median or exact percentileFULLExact percentile functions need all rows on every refresh
Audience built from a table replaced wholesale on each loadFULLIncremental refresh does more work than full when every row is replaced

Keep AUTO for exploration. It resolves once at creation, and if something changes later, refreshes fail rather than switching mode. In production, set the mode explicitly, then confirm it with SHOW DYNAMIC TABLES and read the refresh_mode_reason column.

Suppression logic is the awkward case. The EXCEPT forces FULL, and a full refresh reprocesses all data on every cycle.

Our advice is to isolate the suppression in a small FULL table and join to it from an ADAPTIVE audience table. Snowflake allows that only if the upstream FULL table has a system-derived unique key or a frozen region, so check before you commit to the split.

When does incremental refresh stop paying off?

Snowflake's guideline is that fewer than five percent of base table rows change between refreshes. That figure is a performance guideline, and Snowflake never switches a table's refresh mode automatically based on change volume. If incremental refresh is consistently slower than full refresh for your workload, recreate the table with REFRESH_MODE = FULL.

ADAPTIVE covers the occasional bulk load instead. It reinitialises when its heuristics detect that incremental refresh would cost more than rebuilding, then goes back to incremental. Compare average refresh times in DYNAMIC_TABLE_REFRESH_HISTORY to see which side your table sits on.

What happens when the upstream table gets overwritten?

An overwrite looks like a change to every row. In Snowflake, INSERT OVERWRITE on a base table is one of the scenarios that triggers an ADAPTIVE reinitialisation. Databricks documents the same pattern for materialized views: INSERT OVERWRITE, replaceWhere and dynamic partition overwrite replace every row in the affected partitions, even if the values are identical.

Databricks gives an example. A daily job that rewrites the last 30 days of a table makes all 30 days look changed, even if only one day has new data. A customer table reloaded nightly from a CRM export would behave the same way.

Ask the owner of the load whether MERGE on a stable key is possible. Databricks documents that rows modified with MERGE or UPDATE keep their row IDs, so untouched rows stay out of the changeset. Snowflake's own route is to define a primary key with RELY when an overwrite doesn't change values, which keeps incremental refresh efficient.

If reinitialisation will still happen, set an INITIALIZATION_WAREHOUSE. The occasional rebuild then uses a larger warehouse than routine refreshes do. Upstream schema changes are a separate risk to the same tables, which we cover in schema evolution in event pipelines.

Which failure modes should you plan for?

Silent FULL refresh is the first. If you leave a complex audience on AUTO, Snowflake can resolve it to FULL at creation and the statement still succeeds. The table works, but each refresh reprocesses all data, so read refresh_mode_reason before anyone trusts the cost estimate.

A lag tighter than the consumer is the second. If the sync into your messaging tool runs every 10 minutes, a lag of 60 seconds buys freshness nobody receives. Match the lag to the sync, and write down who is allowed to change it.

An unproven split is the third. The unique key or frozen region requirement can stop the suppression split from working. Prototype it in a sandbox schema before the sync points at it.

Treat the refresh mode as part of the audience definition. Record it in the audience spec so the next engineer knows why FULL was chosen.

How do you roll out an audience table safely?

The sample below uses illustrative table and column names. Check the syntax against the current Snowflake documentation before you run it.

CREATE OR REPLACE DYNAMIC TABLE aud_abandoned_basket
  TARGET_LAG = '10 minutes'
  WAREHOUSE = transform_wh
  INITIALIZATION_WAREHOUSE = transform_wh_xl
  REFRESH_MODE = ADAPTIVE
AS
SELECT b.customer_id, b.basket_id, c.marketing_opt_in
FROM raw_baskets b
JOIN raw_customers c ON c.customer_id = b.customer_id
WHERE b.basket_status = 'ABANDONED'
  AND c.marketing_opt_in = TRUE;

  1. Agree the upstream write pattern (append, MERGE or overwrite) with each table's owner, and check each construct in the audience query against Snowflake's supported-queries list.
  2. Create the table with an explicit REFRESH_MODE and a TARGET_LAG matched to the destination, then run SHOW DYNAMIC TABLES and read refresh_mode and refresh_mode_reason.
  3. Monitor actual lag against the target, and query DYNAMIC_TABLE_REFRESH_HISTORY for REFRESH_ACTION = 'REINITIALIZE' and read REINIT_REASON.

What does this look like for an abandoned-basket audience?

This is a hypothetical example, not a client result. Basket events are appended all day, and the customer table is replaced each night by an overwrite. The audience joins the two and filters to abandoned baskets from customers who opted in.

ADAPTIVE fits this audience, because daytime refreshes stay incremental and the nightly overwrite triggers a reinitialisation on the larger initialisation warehouse. The sync runs every 10 minutes, so a 10 minute lag matches it. Schedule the overwrite outside the campaign send window, so a rebuild never lands mid-send.

Frequently Asked Questions

1. What does target lag mean on a Snowflake dynamic table?

It is a staleness target. Snowflake aims for data no older than the target and treats it as best effort, so actual lag can run longer. The minimum is 60 seconds.

2. Should I leave the refresh mode on AUTO?

Use AUTO for exploration only. It resolves once at creation to ADAPTIVE or FULL and doesn't re-evaluate, so a later change can make refreshes fail. Snowflake advises setting ADAPTIVE, FULL or INCREMENTAL explicitly in production.

3. Why would an audience table never refresh?

One cause is TARGET_LAG = DOWNSTREAM on a table with no downstream dynamic tables. Snowflake gives no warning in that case. Set a duration on the table your sync reads.

4. Does Databricks handle overwrites the same way?

The behaviour is similar. Databricks materialized views make a best-effort attempt at incremental refresh, and overwrites rewrite every affected row. You can define a refresh policy that fails rather than run a full refresh, so check the current Databricks documentation for your product and compute type.

5. Who should own an audience table?

The team that owns the audience definition should own the lag and the refresh mode. Data engineering owns the warehouse and the upstream write pattern. Agree that split before the build starts.

Sources

CustomerIK works across customer data management and martech strategy.

If you are deciding how your audience tables should refresh, let's talk.

Preferences

Privacy is important to us, so you have the option of disabling certain types of storage that may not be necessary for the basic functioning of the website. Blocking categories may impact your experience on the website.

Accept all cookies
Accept all cookies

These items are required to enable basic website functionality.

Always active

These items are used to deliver advertising that is more relevant to you and your interests.

These items allow the website to remember choices you make (such as your user name, language, or the region you are in) and provide enhanced, more personal features.

These items help the website operator understand how its website performs, how visitors interact with the site, and whether there may be technical issues.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.