Skip to main content
Not signed in

D2 · 21% of the exam · ~21 scored items

Querying & Performance

Read the Query Profile, pick the right optimisation, and know what dynamic tables replace.
5 free practice items8 flashcardspass 750/1000

What this domain actually asks

Roughly one in five items. COF-C03 expects you to diagnose a slow query from evidence (spillage, pruning, explosion in rows) and to choose between clustering, the search optimisation service, materialised views and result caching — then to explain why a dynamic table beats a hand-built streams-and-tasks pipeline for a declarative target.

Key concepts

7 ideas that carry most of this domain's marks.

Query Profile evidence

Look for partitions scanned vs total, bytes spilled to local/remote storage, queued time, and operators with disproportionate output rows (joins exploding before a filter). Spillage to remote storage is the classic signal to resize up.

Clustering keys

Best for large tables filtered on high-cardinality columns with range or equality predicates. Clustering is maintained automatically once defined; it costs credits to re-cluster and is not free.

Search Optimization Service

Accelerates selective point lookups, substring/regex searches and geospatial predicates without rewriting the query or changing the table's physical layout. It is complementary to clustering, and it is not a full-text index you query directly.

Materialized views

Pre-computed, automatically maintained result sets refreshed by Snowflake's background service; good for repeated aggregations over large tables, and constrained (limited aggregate functions, no UDFs/joins in the definition).

Result set caching

Identical query text + unchanged micro-partitions returns the previous result within 24 hours, uses no warehouse, and is bypassed by functions like CURRENT_TIMESTAMP unless the query is parameterised consistently.

Semi-structured data

VARIANT holds JSON/Avro/Parquet-ish structures. FLATTEN turns arrays/objects into rows; LATERAL FLATTEN in the FROM clause is how you explode one document into many rows without a join to a helper table.

Dynamic tables (2026 addition)

Declarative transformation: you state the query and a TARGET_LAG, and Snowflake decides when to refresh. Target lag can be a time value or DOWNSTREAM; refresh mode is incremental where possible, full otherwise. This replaces most hand-wired streams-and-tasks chains.

The picture behind this domain

Read the drawing before the bullets: every question on this domain is a step on one of these paths.

Which cache answers the query

D2 · Performance
Hit order: result cache → local disk → remote storageResult cacheLives in Cloud Services24 h, identical SQL0 warehouse credits1 · checked firstLocal disk (SSD)On the warehouse nodeDiscarded at suspendRe-warms on resume2 · needs a warehouseRemote storageMicro-partitions on S3Cold scan, no cacheSlowest, always there3 · always a real readmissmissHIT on both = the same micro-partitions are read from remote storage again.That is why Monday's first query is slow and the Friday repeat is instant.
A result-cache hit is served from Cloud Services with no warehouse running. A local-disk hit still needs a resumed warehouse, and a miss on both reads remote storage.

The comparisons the exam reuses

Each row is a pair candidates mix up. Learn the axis, not the sentence.

Physical change

Clustering key

Search Optimization Service

Clustering rewrites the table's micro-partition ordering and pays off on range scans; search optimisation adds an auxiliary index-like structure for selective lookups and leaves the table layout alone.

Pipeline ownership

Dynamic tables

Streams + Tasks

A dynamic table declares the desired result plus a freshness target and lets Snowflake schedule it. Streams + tasks require you to author the DML, the schedule and the dependency chain.

Freshness vs cost

Materialized view

Dynamic table

Both are maintained for you. A materialized view is a single-table aggregate maintained continuously; a dynamic table can join and transform multiple tables and lets you state the lag you are willing to pay for.

Cache scope

Result cache

Local disk (warehouse) cache

The result cache is account-wide per query text and needs no warehouse; the local disk cache belongs to one running warehouse and is lost on suspend.

New in COF-C03

syllabus additions

Dynamic tables & TARGET_LAG

Reading a TARGET_LAG definition, choosing DOWNSTREAM for chained tables, and predicting whether Snowflake refreshes incrementally or fully. Also: dynamic tables do not replace streams for CDC consumption patterns.

Out of scope · not tested: Not tested: refresh-history internals or exact scheduler timing guarantees (lag is a target, not an SLA).

Keep going