Snowflake

Snowflake Query Acceleration Service (QAS) Complete Guide: SCALE_FACTOR Design and Cost Optimization

2026-03-26
更新: 2026-03-27
NicheeLab Editorial Team

Query Acceleration Service (QAS) is a Snowflake feature that automatically allocates additional serverless compute resources to queries which scan large volumes of data and then drastically reduce the output through filtering or aggregation — cutting execution time as a result. QAS is enabled per warehouse and requires Enterprise Edition or higher.

How QAS Works

When a query runs on a QAS-enabled warehouse, Snowflake analyzes the query plan and detects the scan-then-filter-then-aggregate pattern. If the query is deemed eligible, Snowflake temporarily allocates serverless compute nodes — separate from the warehouse's own cluster — to parallelize the scan phase.

QAS doesn't change how the query executes — it adds resources to the scan phase to break through that bottleneck. As a result, queries that already scan very little data, or queries whose output row count is close to the input, see no benefit.

Enabling QAS via SQL

QAS is enabled on a per-warehouse basis. Set ENABLE_QUERY_ACCELERATION to TRUE and use QUERY_ACCELERATION_MAX_SCALE_FACTOR to cap the resource ceiling.

-- QASを有効化(SCALE_FACTOR = 8)
ALTER WAREHOUSE analytics_wh SET
  ENABLE_QUERY_ACCELERATION = TRUE
  QUERY_ACCELERATION_MAX_SCALE_FACTOR = 8;

-- SCALE_FACTORを変更
ALTER WAREHOUSE analytics_wh SET
  QUERY_ACCELERATION_MAX_SCALE_FACTOR = 4;

-- QASを無効化
ALTER WAREHOUSE analytics_wh SET
  ENABLE_QUERY_ACCELERATION = FALSE;

-- ウェアハウスの設定確認
SHOW WAREHOUSES LIKE 'ANALYTICS_WH';

Designing SCALE_FACTOR

QUERY_ACCELERATION_MAX_SCALE_FACTOR controls the upper limit on the serverless resources QAS can use. It allows resources up to N times the warehouse size.

SCALE_FACTORMeaningRecommended Use Case
0No upper limit (unlimited)When cost ceilings are managed separately
1〜4Up to 1-4x the warehouse sizeCost-conscious setups where you want a limited speed-up
8 (default)Up to 8x the warehouse sizeA balanced default
16〜100Allow large-scale parallelismAnalytics-heavy workloads that prioritize performance

Identifying QAS-Eligible Queries

QAS is not applied to every query. Understanding which queries benefit and which don't is essential.

Query CharacteristicQAS BenefitReason
Large scan → small output (aggregation/filter)HighLarge speed-up from parallelizing the scan
GROUP BY + SUM/COUNT/AVGHighMatches the scan-then-aggregate pattern
ORDER BY ... LIMIT NHighLarge scan reduced to a small result set
LIKE '%keyword%' searchModerateEffective when scan volume is large
SELECT * (full scan, all rows returned)NoneOutput volume is nearly identical to input
INSERT / UPDATE / DELETENoneDML statements are not eligible
SELECT against small data setsNoneAlready fast, so there's nothing to accelerate

Estimating the Acceleration Up Front

To estimate the QAS benefit for a specific query ID in advance, use the SYSTEM$ESTIMATE_QUERY_ACCELERATION function.

-- 特定クエリの加速効果を見積もり
SELECT PARSE_JSON(
  SYSTEM$ESTIMATE_QUERY_ACCELERATION('01abc123-0001-0002-0003-00000000abcd')
) AS estimate;

-- 結果例:
-- {
--   "estimatedQueryTimes": {
--     "1":  120,   -- SCALE_FACTOR=1 での推定時間(秒)
--     "2":  75,
--     "4":  50,
--     "8":  35,
--     "16": 30
--   },
--   "originalQueryTime": 180,
--   "status": "eligible",
--   "upperLimitScaleFactor": 16
-- }

-- QASが適用されたクエリの履歴
SELECT
  QUERY_ID,
  QUERY_ACCELERATION_BYTES_SCANNED,
  QUERY_ACCELERATION_PARTITIONS_SCANNED,
  QUERY_ACCELERATION_UPPER_LIMIT_SCALE_FACTOR
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_HISTORY
WHERE QUERY_ACCELERATION_BYTES_SCANNED > 0
  AND START_TIME >= DATEADD('DAY', -7, CURRENT_TIMESTAMP())
ORDER BY QUERY_ACCELERATION_BYTES_SCANNED DESC;

Cost Model

QAS is billed as serverless credits. The cost is separate from the warehouse's normal credit consumption and is only incurred for the queries to which QAS actually allocated resources.

-- QASのクレジット消費履歴
SELECT
  START_TIME,
  END_TIME,
  WAREHOUSE_NAME,
  CREDITS_USED,
  NUM_FILES_SCANNED,
  NUM_BYTES_SCANNED
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_ACCELERATION_HISTORY
WHERE START_TIME >= DATEADD('DAY', -30, CURRENT_TIMESTAMP())
ORDER BY CREDITS_USED DESC;

-- ウェアハウス別のQASコスト集計
SELECT
  WAREHOUSE_NAME,
  SUM(CREDITS_USED) AS total_qas_credits,
  COUNT(*) AS accelerated_queries
FROM SNOWFLAKE.ACCOUNT_USAGE.QUERY_ACCELERATION_HISTORY
WHERE START_TIME >= DATEADD('DAY', -30, CURRENT_TIMESTAMP())
GROUP BY WAREHOUSE_NAME
ORDER BY total_qas_credits DESC;

QAS vs. Multi-Cluster Warehouses

QAS and multi-cluster warehouses solve different problems.

  • QAS: parallelizes the scan portion of a single heavy query to make it faster. It addresses the depth of a query.
  • Multi-cluster: solves the problem of many concurrent queries piling up in the queue. It addresses the width of the workload.

If QUEUED_OVERLOAD_TIME is high, look into a multi-cluster warehouse. If individual queries have a long TOTAL_ELAPSED_TIME and scan large amounts of data, consider QAS.

Exam-Relevant Takeaways

  • QAS is enabled per warehouse via ENABLE_QUERY_ACCELERATION = TRUE
  • The default SCALE_FACTOR is 8; 0 means no upper limit
  • Eligible queries: the large-scan → small-output (aggregation/filter) pattern
  • Ineligible queries: SELECT *, DML, and queries against small data sets
  • SYSTEM$ESTIMATE_QUERY_ACCELERATION lets you estimate the benefit in advance
  • Requires Enterprise Edition or higher

Check Your Understanding

SnowPro

問題 1

An analyst reports that a GROUP BY aggregation query against a large fact table (5 billion rows) takes more than 15 minutes to run. The warehouse is XLARGE and only one query is running at a time. Which action is the most appropriate way to reduce the execution time?

  1. Enable a multi-cluster warehouse and set MIN_CLUSTER_COUNT = 3
  2. Run ALTER WAREHOUSE SET ENABLE_QUERY_ACCELERATION = TRUE to enable QAS
  3. Resize the warehouse to SMALL and increase the cluster count
  4. Configure a Resource Monitor to cap execution time

正解: B

A single heavy GROUP BY aggregation query that scans a large volume of data and aggregates it is exactly the pattern QAS is designed for. Multi-cluster warehouses exist to relieve queueing from concurrent queries, so they offer no benefit when only one query is running. Resource Monitors cap cost, not performance.

Frequently Asked Questions

What value should I set for the Query Acceleration Service SCALE_FACTOR?

SCALE_FACTOR takes an integer from 1 to 100 and controls how many times the warehouse size QAS can scale up to with serverless resources. The default is 8. Higher values let you parallelize more aggressively but raise the cost ceiling. The recommended approach is to start around 4-8 and adjust while monitoring credit consumption via QUERY_ACCELERATION_HISTORY. Setting it to 0 means no upper limit (unlimited).

What kinds of queries benefit from QAS?

QAS is most effective on queries that scan large volumes of data and then dramatically reduce the output through filtering or aggregation. Concrete examples include SELECT COUNT/SUM/AVG, GROUP BY, DISTINCT, LIKE searches, and ORDER BY ... LIMIT against large tables. Conversely, queries that return nearly all rows scanned (SELECT *) and DML statements see no benefit.

Does enabling QAS automatically accelerate every existing query?

No. At execution time, QAS automatically decides whether a query is eligible and only allocates serverless resources to queries that are expected to benefit. You can also use the SYSTEM$ESTIMATE_QUERY_ACCELERATION function to estimate the speed-up for a specific query ID in advance. Because not every query is accelerated, you only pay for the queries that actually benefit.

Check what you learned with practice questions

Practice with certification-focused question sets

無料で問題を解いてみる
Author

NicheeLab Editorial Team

NicheeLab editorial team focused on data engineering and cloud certification learning. Content is structured around practical study needs and official exam domains.


Related articles
Snowflake

Snowflake Certifications: All 11 Exams Explained (2026)

Every SnowPro certification — Associate, Core, Specialty, Ad...

Snowflake

Snowflake Exam Difficulty Ranking: All 11 Certs Compared (2026)

All 11 SnowPro exams ranked by difficulty with study-time es...

Snowflake

Snowflake Study Guide: Fastest Pass Route by Exam (2026)

How to pass SnowPro certifications efficiently — official ma...

Snowflake

SnowPro Core (COF-C03): Complete Exam Guide (2026)

Pass the SnowPro Core exam — six domains, scope, sample ques...

Snowflake

SnowPro Associate Platform (SOL-C01): Complete Guide (2026)

The entry-level SnowPro Associate exam — scope, weighting, s...

Browse all Snowflake articles (103)
© 2026 NicheeLab All rights reserved.