Home › Certifications › Snowflake SnowPro Core › Performance Optimization, Querying and Transformation
63 multiple-choice questions and 19 flashcards on Performance Optimization, Querying and Transformation, about 21% of the Snowflake SnowPro Core bank. Every one carries a written rationale.
Performance Optimization, Querying and Transformation is one of 9 chapters in CoStudy's Snowflake SnowPro Core bank, and it holds 63 of the bank's 301 multiple-choice questions — roughly 21% of the total. That proportion is not arbitrary: chapters follow the certifying body's published exam outline, and the number of questions in each is set by that domain's published weight, so the share of your practice time this chapter takes matches the share of the real exam it accounts for.
Studying by chapter is worth doing once you have a diagnostic score. A single overall percentage tells you whether you are close; it does not tell you which domain is dragging. Working a weak chapter in isolation, and re-testing it in isolation, is the fastest way to move a score that has stalled — and it is why the mock exams in CoStudy report by domain rather than as one number.
10 questions drawn from this chapter, with the full rationale shown — the controlling principle behind the right answer, and why each wrong option tempts and fails.
A stream has become stale. The controlling principle behind staleness is that:
Answer: D — A stream is stale once its offset falls outside the base table's retention period
D) Correct — a stream depends on the base table's change records within data retention, so an unconsumed offset older than that window can no longer be resolved. A) There is no fixed expiry independent of consumption and retention. B) Cloning creates an independent object and does not invalidate the source stream. C) Streams do not have a separate storage quota that governs staleness.
Clustering is LEAST likely to be worth its cost on a table that is:
Answer: C — Modest in size and rewritten in full by a nightly ordered load
C) Correct — a smaller table that is fully rewritten in sorted order each night already arrives well organized, so paying for continuous maintenance adds cost with little gain. A) That is the canonical case where clustering pays off. B) Large and stable with a consistent predicate is also a strong fit, since maintenance cost is low. D) Append-only large tables with a repeated filter benefit clearly from clustering.
APPEND_ONLY = TRUE on a stream means:
Answer: C — Tracks inserts only, with lower overhead and storage cost
C) Correct — an append-only stream records inserts and skips updates and deletes, which makes it cheaper to maintain. A) Deletes are exactly what append-only omits. B) That describes the default standard stream. D) Streams never delete data from the source table.
A VARIANT field holding numeric strings is compared against an integer literal and no rows match. The BEST correction is:
Answer: D — Cast the extracted value to a numeric type before comparing it to the literal
D) Correct — values pulled from a VARIANT retain VARIANT typing, so an explicit cast is needed for the comparison to behave numerically. A) Changing the declared type does not fix an untyped extraction. B) FLATTEN expands collections; it does not resolve a type mismatch. C) Search optimization accelerates predicates but does not change comparison semantics.
Stored procedures in Snowflake CAN:
Answer: C — Run multi-statement logic in SQL Scripting or Snowpark languages
C) Correct — stored procedures execute programmatic logic with branching, loops, and transactions. A) Their scope is much wider than one SELECT. B) A procedure can open and commit transactions itself. D) There is no warehouse-size restriction.
A multi-statement transaction is opened with BEGIN, and the session disconnects before COMMIT. The outcome is that the transaction:
Answer: D — Is rolled back, so none of its uncommitted changes become visible
D) Correct — an uncommitted transaction abandoned by a lost session is rolled back, preserving all-or-nothing semantics. A) Transactions are scoped to their session and cannot be adopted by another. B) Treating a disconnect as a commit would make partial work durable, which the model forbids. C) Statements inside an explicit transaction do not revert to autocommit after the fact.
Regarding task trees, which statement is accurate?
Answer: D — Only the root task carries a schedule; children run after their predecessors
D) Correct — dependency is expressed with AFTER, so children are triggered by predecessor completion while only the root is scheduled. A) Children have no schedule of their own to align. B) Defining a schedule on a child conflicts with its predecessor relationship. C) Execution honors the declared dependency order rather than running everything at once.
Which is TRUE about Snowflake Streams?
Answer: B — Streams track CDC offsets; consuming DML advances the offset
B) Correct — a stream records an offset on the source table and advances it when DML that reads the stream commits. A) Streams store change metadata, not duplicated rows. C) Queries on a stream still need a warehouse. D) With APPEND_ONLY = FALSE, updates are captured.
A query profile shows most execution time in a single Sort operator with local spilling. Aside from resizing, the BEST tuning step is:
Answer: D — Reduce the rows or columns entering the sort by filtering and projecting earlier
D) Correct — sorts are memory-bound, so cutting cardinality and width before the sort attacks the cause directly. A) Clustering influences pruning and data locality but does not remove a required global sort. B) Materialized views do not guarantee a stored global ordering that eliminates the operator. C) Search optimization targets selective lookups, not sorting.
A session runs several DML statements without an explicit BEGIN. One statement fails. The result is that:
Answer: D — Each statement was its own autocommitted transaction, so earlier ones persist
D) Correct — with autocommit on, each statement commits independently, so a later failure leaves earlier committed statements in place. A) A session is not implicitly one transaction; that requires an explicit BEGIN. B) A failed statement's own changes are rolled back, not left behind. C) Snowflake does not silently retry failed DML.
4 cards from the 19 in this chapter.
VARIANT data type?
Semi-structured (JSON, Avro, XML). Stored efficiently with auto-detected schema. Query with dot/bracket notation.
What are the key restrictions and cost characteristics of a Snowflake materialized view?
A materialized view can reference only a single table, cannot use joins, most window functions, or UDFs, and cannot include ORDER BY. It is maintained automatically by serverless compute, so it incurs both storage and background maintenance credits, and it is available in Enterprise Edition and above.
What is the essential difference between a UDF and a stored procedure in Snowflake?
A UDF returns a value and is called inside a SQL expression; scalar and table UDFs can be written in SQL, JavaScript, Python, Java or Scala. A stored procedure is called with CALL, is used for procedural control flow and administrative work, and may perform DDL and DML as side effects rather than being usable in a SELECT list.
What is a clustering key, and when is defining one justified?
A clustering key is one or more columns Snowflake uses to co-locate related rows across micro-partitions, with automatic clustering maintaining it in the background using serverless credits. It is justified on very large tables (typically multi-terabyte) queried with selective filters or joins on that column where pruning is currently poor. Small or frequently fully-rewritten tables do not benefit.
These are a sample. The full Performance Optimization, Querying and Transformation chapter runs 82 items with per-chapter progress tracking, on the web and in the iOS app.
Open Snowflake SnowPro Core in CoStudy →