Actionable rules that keep Snowflake workloads fast, affordable, and secure.
Following published guidelines avoids slow queries, runaway costs, and security gaps. The payoff is predictable performance, smaller invoices, and peace of mind.
Start Small (X-Small or Small) and auto-suspend after 60 s. Scale up only when concurrency or scan time requires it.Monitor credits used via ACCOUNT_USAGE views.
create or replace warehouse wh_reporting
with warehouse_size = 'SMALL'
auto_suspend = 60
auto_resume = true;
Turn on multi-cluster only for high-concurrency dashboards. Set MIN_CLUSTER_SIZE=1 and MAX_CLUSTER_SIZE to the lowest number that eliminates queueing.
Define CLUSTER BY columns used in large table filters.For Orders, clustering on (customer_id, order_date) reduces micro-partitions scanned in customer-centric reports.
create or replace table Orders (
id number,
customer_id number,
order_date date,
total_amount number,
cluster by (customer_id, order_date)
);
Result cache is free and lasts 24 h; reuse it with identical SQL and role.Metadata and data caches live in warehouse memory; keep them warm by avoiding unnecessary resumes.
Stage data with compression (GZIP/Parquet), partition large files, and drop transient tables once queries finish. Schedule automatic RETENTION_TIME trims for historical tables.
alter table OrderItems set data_retention_time_in_days = 7;
Use role hierarchy: ACCOUNTADMIN → SECURITYADMIN → custom roles. Mask PII columns (Customers.email) with dynamic data masking policies. Enforce network policies to whitelist corporate IPs.
.
Run EXPLAIN
; the PRUNED_PARTITIONS column should be high. Also check QUERY_HISTORY for PARTITIONS_SCANNED vs PARTITIONS_TOTAL.
Yes, but avoid loading the same files twice. Name each file uniquely and stage them in separate folders.
With resume times <500 ms, auto-suspend rarely hurts user experience. Keep it at 60–300 s to save credits without noticeable lag.