How does Snowflake use micro-partition metadata for query pruning, and why does it not use user-defined indexes?

Quick Overview

Asks how Snowflake uses per-column micro-partition metadata to skip data at query time, and why its standard tables have no user-defined indexes. Tests understanding of min/max pruning, how data layout and clustering affect it, and the storage and workload reasons behind the design.

How does Snowflake use micro-partition metadata for query pruning, and why does it not use user-defined indexes?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

How does Snowflake use micro-partition metadata to prune data at query time, and why does Snowflake not use user-defined indexes the way many relational databases do? ```hint Picture one partition's metadata For each column, every micro-partition records a small summary of the values it holds. Ask what that summary lets the engine rule out, and what the data layout has to look like for it to rule out much. ``` ```hint Think about the workload Consider which queries a B-tree index speeds up, and what it costs to keep an index current when data arrives in large batches and is stored in immutable files. ``` ### What a Strong Answer Covers - What micro-partitions are and what metadata Snowflake keeps for each column. - How a filter is checked against that metadata to skip partitions, with an example. - The situations where pruning skips little or nothing. - Why standard tables have no user-defined indexes, given the storage model and the analytic workload. - The features that improve pruning or point lookups, and what they cost. ### Follow-up Questions - A query that filters on `customer_id` scans almost every partition of a large table. How would you diagnose and fix it? - How do you measure how well a table is clustered on a given column? - When would you pay for automatic clustering, and when would sorting the data at load time be enough? - How would you speed up highly selective point lookups on a column that is not a good clustering key?

Overview: Asks how Snowflake uses per-column micro-partition metadata to skip data at query time, and why its standard tables have no user-defined indexes. Tests understanding of min/max pruning, how data layout and clustering affect it, and the storage and workload reasons behind the design.

Nov 25, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

How does Snowflake use micro-partition metadata to prune data at query time, and why does Snowflake not use user-defined indexes the way many relational databases do?

What a Strong Answer Covers Guidance

  • What micro-partitions are and what metadata Snowflake keeps for each column.
  • How a filter is checked against that metadata to skip partitions, with an example.
  • The situations where pruning skips little or nothing.
  • Why standard tables have no user-defined indexes, given the storage model and the analytic workload.
  • The features that improve pruning or point lookups, and what they cost.

Follow-up Questions Guidance

  • A query that filters on customer_id scans almost every partition of a large table. How would you diagnose and fix it?
  • How do you measure how well a table is clustered on a given column?
  • When would you pay for automatic clustering, and when would sorting the data at load time be enough?
  • How would you speed up highly selective point lookups on a column that is not a good clustering key?