Which SQL statement requires an active running warehouse?

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

Multiple Choice

Which SQL statement requires an active running warehouse?

Explanation:
The key idea is that some aggregate calculations can be answered from metadata stored with micro-partitions, without scanning all the data. Snowflake keeps statistics like per-partition min, max, and row_count. You can often combine those to get MIN or MAX across the whole table and sum the per-partition row_counts for COUNT(*) without touching the actual rows. But AVG needs the total sum of all values and the total number of rows, which cannot be derived from metadata alone. To compute that accurately, the engine must read and process the data, so an active running warehouse is required for an AVG query.

The key idea is that some aggregate calculations can be answered from metadata stored with micro-partitions, without scanning all the data. Snowflake keeps statistics like per-partition min, max, and row_count. You can often combine those to get MIN or MAX across the whole table and sum the per-partition row_counts for COUNT(*) without touching the actual rows. But AVG needs the total sum of all values and the total number of rows, which cannot be derived from metadata alone. To compute that accurately, the engine must read and process the data, so an active running warehouse is required for an AVG query.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy