1. An analyst runs SELECT COUNT(*) FROM orders; on a table that has not been modified in several days. The query completes in milliseconds and shows 0 bytes scanned. Which caching mechanism is responsible for this behavior?
- A. Warehouse (local disk) cache — the micro-partition data was cached on the warehouse SSD.
- B. Result cache — an identical query result was stored in Cloud Services and returned without executing.
- C. Metadata cache — Snowflake maintained the row count as table-level metadata in Cloud Services and answered without scanning any data.✓ Correct
- D. Materialized view cache — a pre-computed COUNT(*) was stored as a materialized view.
Explanation
COUNT(*) on a table is answered directly from the metadata cache maintained in the Cloud Services layer. Snowflake tracks statistics like row counts in micro-partition metadata, so no data scan is needed — hence 0 bytes scanned. Option A is incorrect; the warehouse cache stores raw micro-partition data and would still require some scanning. Option B is plausible (result cache can also return 0 bytes scanned), but the key differentiator here is the 0 bytes scanned behavior for an aggregate like COUNT(*) which is definitively served from metadata. If the result cache were used, the bytes scanned would also be 0, but the metadata cache is the root mechanism for COUNT(*) specifically. Option D is incorrect; no materialized view was mentioned and they must be explicitly created.