Study FAQ
How does Snowflake use micro-partitions to prune a query?
Also asked as 2
- Why do selective filters scan fewer Snowflake micro-partitions?
- How can I tell whether my Snowflake query is pruning micro-partitions effectively?
Answer
Snowflake automatically puts standard table rows into compressed, columnar micro-partitions, each typically containing 50–500 MB before compression. When a predicate can use metadata such as a column’s value range, Snowflake skips partitions that cannot contain matching rows. Within the remaining partitions, it can read only the columns needed by the query.
For example, a narrow, typed timestamp range on an events table loaded roughly in time order can exclude partitions outside that range. If matching values are spread across heavily overlapping partitions, the same predicate may scan many more. Prefer direct typed comparisons where they express the same condition and project only the columns you need. Snowflake creates and maintains the micro-partitions automatically.
Open the relevant table scan in Query Profile and compare partitions scanned with partitions total, alongside bytes scanned. Compare representative filter ranges before changing physical layout. Choose the denominator and table scan carefully when the query reads several tables.
Micro-partitions and data clustering · Query Profile statistics
Full explanation
Snowflake Objects, Micro-partitions, and Data Organization
Study guide · COF-C03
Read the full explanation