Snowflake prunes micro-partitions based on a predicate with a subquery, even if the subquery results in a constant.

Master the SnowPro Advanced Architect Test with flashcards, multiple-choice questions, and detailed explanations. Prepare thoroughly for your certification!

Multiple Choice

Snowflake prunes micro-partitions based on a predicate with a subquery, even if the subquery results in a constant.

Explanation:
Pruning relies on zone maps that summarize each micro-partition with min/max values and is safe only when the predicate can be evaluated using those statistics alone. A predicate that contains a subquery requires computing that subquery’s value before you can decide if a partition could contain matching rows, which the pruning logic does not do. Even if the subquery happens to return a constant, the overall predicate still depends on data in the partitions, and relying on a constant subquery would not provide a deterministic, partition-level decision. For effective pruning, keep predicates simple and directly on the column values (the keys Snowflake uses for zone maps). Therefore, this statement is false.

Pruning relies on zone maps that summarize each micro-partition with min/max values and is safe only when the predicate can be evaluated using those statistics alone. A predicate that contains a subquery requires computing that subquery’s value before you can decide if a partition could contain matching rows, which the pruning logic does not do. Even if the subquery happens to return a constant, the overall predicate still depends on data in the partitions, and relying on a constant subquery would not provide a deterministic, partition-level decision. For effective pruning, keep predicates simple and directly on the column values (the keys Snowflake uses for zone maps). Therefore, this statement is false.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy