Skip to content

Tune Snowflake warehouses for Astrato

13 min read · Updated 25 Nov 2026

Astrato does not copy your data. Every dashboard load, filter change and business question sends a query to your Snowflake warehouse, so the warehouse’s settings decide how fast answers come back and how many credits they use. This page shows how to set up a warehouse for that workload and the trade-off each setting makes. Snowflake defines every setting named here; the links go to Snowflake’s documentation for the full rules and for what your edition supports.

To create the connection itself, see Connect to Snowflake.

Astrato runs its queries on the warehouse set under Session on the data connection:

  • With Private key (Recommended) or Password (legacy), it is the Warehouse you choose when you create or edit the connection.
  • With Sign in with Snowflake, Warehouse reads User default: each person’s queries run on their own Snowflake user’s default warehouse, unless you select Advanced beside the Session heading and choose one warehouse for everyone.

The form is described in Create the connection, and what each sign-in method means for access in Shared or per-person access to Snowflake. The role Astrato uses needs USAGE on the warehouse; see Role and privileges.

Astrato sets the Snowflake session query tag Astrato, so you can find its queries in Snowflake’s query history and attribute their cost; see Watch what Astrato costs.

This creates an X-Small warehouse that suspends after 60 seconds idle, resumes when a query arrives, and scales out to two clusters under load. The sections below explain each setting, so you can change the values for your workload.

-- X-Small warehouse for Astrato dashboards
CREATE WAREHOUSE ASTRATO_WH
WAREHOUSE_SIZE = 'XSMALL'
AUTO_SUSPEND = 60 -- seconds idle before suspending
AUTO_RESUME = TRUE -- start again when a query arrives
INITIALLY_SUSPENDED = TRUE
MIN_CLUSTER_COUNT = 1 -- multi-cluster settings need Enterprise Edition or higher
MAX_CLUSTER_COUNT = 2
SCALING_POLICY = 'STANDARD'; -- or 'ECONOMY' to favour credits over wait time

Without Enterprise Edition, leave out the three cluster settings. Then grant the connection’s role USAGE on the warehouse and choose it as the connection’s Warehouse.

A warehouse’s size sets its compute and memory. Each size up doubles the compute, and doubles the credits the warehouse uses per hour while it runs. A standard X-Small warehouse uses 1 credit per hour; Snowflake lists every size and warehouse type in Understanding compute cost.

Start with X-Small or Small for dashboards over a reporting layer of modest tables, and size up only when queries show they need it:

  • A query spills. When a query runs out of memory, Snowflake writes intermediate results to local disk and then to remote storage, which is much slower. A larger warehouse has more memory. In Astrato, the Memory check in query insights flags this; see Find out why a query is slow, and Snowflake’s Queries too large to fit in memory.
  • A single large query is slow even when nothing else is running. More compute usually shortens it, often by about as much as the extra cost, so the credits per query stay similar.

A larger size can reduce queuing when concurrent queries run short of compute, but resizing is not Snowflake’s tool for concurrency. When many people query at once, use a multi-cluster warehouse or separate warehouses. Before sizing up, check whether the query reads more data than it needs: filtering earlier, or clustering the table on the column you filter by, can cut the work more cheaply. Snowflake’s Warehouse considerations covers how to experiment with sizes.

Snowflake bills a running warehouse per second, with a minimum of 60 seconds each time it starts or resumes. Auto-suspend stops the warehouse after it has been idle for the time you set, and auto-resume starts it again when the next query arrives. Keep auto-resume on for the Astrato warehouse: a suspended warehouse without it rejects Astrato’s queries until someone resumes it.

CREATE WAREHOUSE defaults to an auto-suspend of 600 seconds. The right value is a trade-off:

  • Shorter stops paying for idle time sooner. Values below 60 seconds rarely save anything, because each resume is billed for at least 60 seconds.
  • Longer keeps the warehouse cache, which suspending clears, so the next dashboard load reads table data from local storage instead of remote storage. See Make repeat queries cheaper.

For dashboards used in bursts, start at 60 seconds to a few minutes. For dashboards in steady use through the day, a longer value keeps the cache warm. A warehouse used only for loading data or scheduled work can suspend as soon as it finishes.

To change it on an existing warehouse:

ALTER WAREHOUSE ASTRATO_WH SET AUTO_SUSPEND = 300 AUTO_RESUME = TRUE;

When more queries arrive than a warehouse can run at once, Snowflake queues them, and everyone waiting sees a slower dashboard. A multi-cluster warehouse, available in Enterprise Edition and higher, starts extra clusters of the same size while the load lasts and stops them afterwards. You pay for each extra cluster only while it runs. See Multi-cluster warehouses.

Set MIN_CLUSTER_COUNT = 1 and a MAX_CLUSTER_COUNT above 1 to let Snowflake scale out. The scaling policy decides how quickly it adds clusters:

SCALING_POLICY Starts a cluster Suits
STANDARD (default) As soon as queries begin to queue Interactive dashboards, where response time matters most
ECONOMY Only when Snowflake estimates there is enough load to keep it busy for some minutes Workloads where saving credits matters more than queuing longer

Without Enterprise Edition, give Astrato a dedicated warehouse so other workloads do not queue in front of its queries.

The query acceleration service, available in Enterprise Edition and higher, offloads parts of eligible queries, typically large scans with selective filters or aggregation, to serverless compute. It helps when a warehouse sized for the usual light queries also gets an occasional heavy one, without sizing the whole warehouse up. Accelerated work is billed as serverless credits on top of the warehouse’s own.

  1. Check whether a slow query would benefit: pass its query ID to SYSTEM$ESTIMATE_QUERY_ACCELERATION. The query ID is shown in Astrato’s query insights; see Find out why a query is slow.

  2. Turn it on for the warehouse, with a cap on how much extra compute it can use:

    ALTER WAREHOUSE ASTRATO_WH SET
    ENABLE_QUERY_ACCELERATION = TRUE
    QUERY_ACCELERATION_MAX_SCALE_FACTOR = 4;

See Using the Query Acceleration Service.

Snowflake has two caches that help repeat queries:

  • The result cache. When a query is identical to one run before and the data it reads has not changed, Snowflake returns the stored result without running it, and without using warehouse credits. A result is kept for 24 hours, and each reuse extends that, up to 31 days from when the query first ran. Queries that call functions whose value changes on each run, such as RANDOM, are not reused. See Using persisted query results for every condition.
  • The warehouse cache. A running warehouse keeps table data it has read on local storage, so later queries on the same tables read less from remote storage. Suspending the warehouse clears it. See Optimizing the warehouse cache.

The result cache is why a dashboard that several people open with the same filters costs little after the first load. Data loaded often, for example every few minutes, invalidates cached results just as often.

To see whether a query was answered from the result cache, open its query insights: the profile shows only Cached result used. See Find out why a query is slow.

Snowflake stores a table in micro-partitions and skips the ones a query’s filters rule out. When the rows a query needs are spread across most partitions, it reads most of the table. A clustering key tells Snowflake to keep rows with similar values in a column together, so filtering on that column reads far fewer partitions. See Clustering keys and clustered tables.

Automatic clustering reorganises the table in the background as data changes, billed as serverless credits. It pays off when:

  • the table is large: Snowflake aims clustering keys at multi-terabyte tables;
  • queries often filter on the same columns, such as the date, region or customer column your dashboard filters use;
  • the table is queried far more often than it changes. Frequent MERGE, UPDATE or DELETE work causes reclustering that can cost more than it saves.

Choose columns with enough distinct values to separate the data, but not so many that every row is different: cluster a timestamp as TO_DATE(<column>) rather than the raw value. Snowflake recommends at most three or four columns or expressions per key.

-- Cluster the orders table on the order date
ALTER TABLE SALES.RAW.ORDERS CLUSTER BY (TO_DATE(ORDERED_AT));

In Astrato, the Pruning check in query insights flags a query that scanned more than 40% of the partitions of a table with more than 2,000 of them, a sign the table is not organised by the column you filtered on.

A Snowflake view, or a SQL view in your semantic layer, runs its whole query, joins and aggregations included, inside every query that reads it: behind a dashboard, on every load and every filter change. When those queries are slow or costly, store the result once and let Astrato read the stored result. Snowflake offers three ways:

Option What it stores How it stays current
Materialized view The result of a query on a single table, with no joins. Needs Enterprise Edition or higher. Snowflake maintains it automatically, billed as serverless credits.
Dynamic table The result of a query, joins included, within Snowflake’s supported queries. Snowflake aims to refresh it within the TARGET_LAG you set, using a warehouse you name.
Scheduled task that rebuilds a table The result of any query, as a plain table. Rebuilt on your schedule; between runs it shows the data as of the last run.

Dynamic tables and scheduled tables trade freshness for speed: dashboards show the data as of the last refresh. A materialized view always returns current results, because Snowflake reads newer rows from the base table when its maintenance is behind. All three use credits to stay current. Run the refresh on a separate warehouse so it does not compete with dashboard queries.

A dynamic table is usually the simplest choice for a joined, aggregated reporting table. The names in this example are placeholders:

-- Daily sales per region; Snowflake aims to keep it within an hour of its sources
CREATE OR REPLACE DYNAMIC TABLE SALES.REPORTING.DAILY_SALES
TARGET_LAG = '1 hour'
WAREHOUSE = TRANSFORM_WH
AS
SELECT o.ORDER_DATE, c.REGION, SUM(o.AMOUNT) AS REVENUE, COUNT(*) AS ORDERS
FROM SALES.RAW.ORDERS o
JOIN SALES.RAW.CUSTOMERS c ON c.CUSTOMER_ID = o.CUSTOMER_ID
GROUP BY o.ORDER_DATE, c.REGION;

TARGET_LAG is a target, not a guarantee: when refreshes take longer, the table falls further behind its sources. Monitor its actual lag; see Snowflake’s target lag guide.

A task gives you full control of when the work runs. This one rebuilds the table at 07:00, 10:00, 13:00 and 16:00 UTC. A new task is created suspended, so resume it once. Running a task needs the EXECUTE TASK privilege; see Introduction to tasks.

CREATE OR REPLACE TASK SALES.REPORTING.REBUILD_DAILY_SALES
WAREHOUSE = TRANSFORM_WH
SCHEDULE = 'USING CRON 0 7,10,13,16 * * * UTC'
AS
CREATE OR REPLACE TABLE SALES.REPORTING.DAILY_SALES COPY GRANTS AS
SELECT o.ORDER_DATE, c.REGION, SUM(o.AMOUNT) AS REVENUE, COUNT(*) AS ORDERS
FROM SALES.RAW.ORDERS o
JOIN SALES.RAW.CUSTOMERS c ON c.CUSTOMER_ID = o.CUSTOMER_ID
GROUP BY o.ORDER_DATE, c.REGION;
ALTER TASK SALES.REPORTING.REBUILD_DAILY_SALES RESUME;
-- Confirm the task's state is started
SHOW TASKS IN SCHEMA SALES.REPORTING;

COPY GRANTS keeps the privileges already granted on the table each time the task replaces it.

The role on the Astrato connection needs SELECT on the new table, dynamic table or materialized view. The ALL grants in Role and privileges cover only objects that existed when they ran, and COPY GRANTS keeps only grants the table already has, so a table the task creates for the first time is not readable yet. A future grant does not fix this: it does not cover a table that already exists, and a table replaced with COPY GRANTS does not take on future grants.

  • For a table built by a task, grant SELECT explicitly after the first build.
  • For dynamic tables and materialized views, set future grants before you create them, or grant SELECT afterwards.
-- After the task's first build
GRANT SELECT ON TABLE SALES.REPORTING.DAILY_SALES TO ROLE ASTRATO_READER;
-- Before you create dynamic tables or materialized views in the schema
GRANT SELECT ON FUTURE DYNAMIC TABLES IN SCHEMA SALES.REPORTING TO ROLE ASTRATO_READER;
GRANT SELECT ON FUTURE MATERIALIZED VIEWS IN SCHEMA SALES.REPORTING TO ROLE ASTRATO_READER;

Then add the table to your semantic layer as you would any other; see Bring tables and model items in.

Snowflake bills a warehouse for the time it runs, not for how busy it is. A warehouse that answers a one-second query every minute never reaches its auto-suspend time, so it runs, and is billed, for the whole hour while working for one minute of it.

Choice Gains Costs
Shared with other light workloads Queries from Astrato and other tools run in time already paid for and share the warehouse cache. With a multi-cluster warehouse, extra clusters start only when the combined load needs them. Heavy work from another tool can queue Astrato’s queries, and the warehouse’s bill does not say which workload used what.
Dedicated to Astrato The warehouse’s bill is Astrato’s cost, other workloads cannot queue in front of its queries, and you can size and suspend it for dashboard use alone. More idle running time across your warehouses.

On a shared warehouse, the Astrato query tag still lets you attribute cost per query; see Watch what Astrato costs. To use a dedicated warehouse, set it as the connection’s Warehouse; see Which warehouse Astrato uses.

These Snowflake settings stop runaway queries and spending:

  • Statement timeouts. STATEMENT_TIMEOUT_IN_SECONDS cancels a query that runs longer than the limit, and STATEMENT_QUEUED_TIMEOUT_IN_SECONDS cancels one that waits in the queue too long. Set them on the warehouse, user or account; see Parameters. Astrato stops waiting for a query after 120 seconds by default, so a Snowflake timeout shorter than that ends Astrato’s queries sooner. Over MCP, the query tools accept a longer queryTimeout, up to 600 seconds, and a timed-out read can be retried once automatically, so it may run on Snowflake twice; see Results and resources.
  • Resource monitors. A resource monitor tracks the credits warehouses use against a quota per day, week, month or year. At thresholds you set, it notifies administrators, suspends the warehouse once running queries finish, or suspends it at once and cancels them. Resource monitors cover warehouses only, not serverless features such as query acceleration, automatic clustering or materialized view maintenance. See Working with resource monitors.

A monitor that only notifies still tells you when usage jumps unexpectedly, for example after someone sizes a warehouse up and leaves it that way.

Snowflake’s SNOWFLAKE.ACCOUNT_USAGE schema records queries and credits for the account. Because Astrato tags its queries Astrato, you can separate them from the rest. This query, run with a role that can read ACCOUNT_USAGE, totals the compute credits attributed to Astrato’s queries per warehouse over the last seven days:

SELECT WAREHOUSE_NAME,
COUNT(*) AS QUERIES,
SUM(CREDITS_ATTRIBUTED_COMPUTE) AS CREDITS
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_ATTRIBUTION_HISTORY
WHERE QUERY_TAG = 'Astrato'
AND START_TIME >= DATEADD(day, -7, CURRENT_TIMESTAMP())
GROUP BY WAREHOUSE_NAME
ORDER BY CREDITS DESC;

Read the result with these limits in mind:

  • Attributed credits cover the time queries ran, not the warehouse’s idle time before it suspends. For the full bill, read WAREHOUSE_METERING_HISTORY; on a dedicated warehouse, that is Astrato’s whole cost.
  • The attribution view can lag by several hours, leaves out very short queries, and has no rows for queries answered from the result cache, so soon after setup it can show little or nothing.
  • Snowflake also bills cloud services, such as compiling queries and answering metadata requests, but only the part of each day’s use above 10% of that day’s warehouse credits.

Snowflake describes the views in QUERY_ATTRIBUTION_HISTORY view and Account Usage, and cloud services billing in Understanding compute cost.

To break Astrato’s queries down by workbook, sheet and user, read the metadata Astrato attaches to each query; see Query telemetry: Snowflake.

Run the question in Data Explorer and select View query insights. It shows the SQL Astrato ran and the query ID, and from Snowflake’s query profile the Cartesian, Union, Memory and Pruning checks, Estimated credits and Rows scanned. Two of the checks point to a fix on this page:

  • Memory flags a query that spilled: the warehouse may be too small for it; see Choose a size.
  • Pruning flags a large table read mostly in full; see Cluster large tables.
  • Cached result used in place of the checks means Snowflake answered from the result cache.

Cartesian and Union point to how the data is modelled rather than to a warehouse setting. What each check means, and what to do about those two, is in Query insights. For the full breakdown of one query, open it in Snowflake’s Query Profile.