What are clustering depth and overlap in Snowflake, and how do you evaluate them with SYSTEM$CLUSTERING_INFORMATION?

Quick Overview

A Snowflake question on what clustering depth and overlap measure for micro-partitions and how to read the output of SYSTEM$CLUSTERING_INFORMATION. It tests partition pruning, reading the depth histogram, and judging when a clustering key or re-clustering is worth the cost.

What are clustering depth and overlap in Snowflake, and how do you evaluate them with SYSTEM$CLUSTERING_INFORMATION?

Role: Data Scientist

Category: Data Manipulation (SQL/Python)

Difficulty: medium

Interview Round: Other

What are clustering depth and overlap as clustering health metrics for a Snowflake table, and how do you use `SYSTEM$CLUSTERING_INFORMATION` to evaluate them? ```hint Start from pruning Each micro-partition stores the min and max of the clustering key. Think about how many partitions a query for one key value has to open. ``` ```hint Read the whole output The function returns more than one number. Ask what the distribution of depths tells you that the average hides. ``` ### What a Strong Answer Covers - A correct definition of clustering depth and of overlap in terms of micro-partition min/max ranges, and which direction is better - How both metrics connect to partition pruning and query cost - The fields the function returns and how to read the depth histogram - How to call the function, including on a column that is not the current clustering key - When the numbers justify adding a key or re-clustering, and why they are a poor target on their own ### Follow-up Questions - Why can a table with a low average depth still be slow for one particular query pattern? - How does Automatic Clustering change these metrics over time, and what does it cost? - How would you use this function to choose a clustering key for a large events table before committing to it? - What are constant micro-partitions, and why does their count matter?

Overview: A Snowflake question on what clustering depth and overlap measure for micro-partitions and how to read the output of SYSTEM$CLUSTERING_INFORMATION. It tests partition pruning, reading the depth histogram, and judging when a clustering key or re-clustering is worth the cost.

PracHub logo
General
Nov 24, 2026
mediumData ScientistOtherData Manipulation (SQL/Python)
0
0

What are clustering depth and overlap as clustering health metrics for a Snowflake table, and how do you use SYSTEM$CLUSTERING_INFORMATION to evaluate them?

What a Strong Answer Covers Guidance

  • A correct definition of clustering depth and of overlap in terms of micro-partition min/max ranges, and which direction is better
  • How both metrics connect to partition pruning and query cost
  • The fields the function returns and how to read the depth histogram
  • How to call the function, including on a column that is not the current clustering key
  • When the numbers justify adding a key or re-clustering, and why they are a poor target on their own

Follow-up Questions Guidance

  • Why can a table with a low average depth still be slow for one particular query pattern?
  • How does Automatic Clustering change these metrics over time, and what does it cost?
  • How would you use this function to choose a clustering key for a large events table before committing to it?
  • What are constant micro-partitions, and why does their count matter?