0
0
Snowflakecloud~20 mins

Clustering keys for large tables in Snowflake - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Clustering Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why use clustering keys on large tables?

Imagine you have a huge table with millions of rows. Why would adding clustering keys help when querying this table?

AClustering keys duplicate data to make queries run faster.
BClustering keys physically sort the data to speed up queries that filter on those keys.
CClustering keys automatically compress the data to reduce storage size.
DClustering keys create indexes that speed up all types of queries regardless of filters.
Attempts:
2 left
💡 Hint

Think about how data is stored and accessed on disk.

Model Choice
intermediate
2:00remaining
Choosing clustering keys for time-series data

You have a large table storing sensor readings with columns: sensor_id, reading_time, temperature. Which clustering key choice is best to speed up queries filtering by recent time ranges?

ACLUSTER BY (reading_time)
BNo clustering key needed
CCLUSTER BY (temperature)
DCLUSTER BY (sensor_id)
Attempts:
2 left
💡 Hint

Queries filter mostly by recent timestamps.

Hyperparameter
advanced
2:00remaining
Impact of too many clustering keys

What is a likely effect of defining too many clustering keys on a large table?

AIncreased maintenance cost and slower data loading due to complex clustering.
BAutomatic removal of unused keys by Snowflake.
CImproved query speed for all queries without any downsides.
DNo effect; clustering keys do not impact performance.
Attempts:
2 left
💡 Hint

Think about the cost of maintaining physical data order.

Metrics
advanced
2:00remaining
Evaluating clustering effectiveness

Which metric helps you understand if your clustering keys are effective in Snowflake?

ATotal storage size of the table.
BNumber of rows in the table.
CClustering depth metric showing how well data is sorted by keys.
DNumber of columns in the table.
Attempts:
2 left
💡 Hint

Look for a metric that measures data organization quality.

🔧 Debug
expert
2:00remaining
Why is clustering not improving query speed?

You added clustering keys on columns user_id and event_date for a large events table. But queries filtering on event_date are still slow. What is the most likely reason?

ASnowflake does not support clustering on date columns.
BClustering keys only speed up queries filtering on all key columns together.
CThe table is too small for clustering to have any effect.
DThe clustering keys are defined in the wrong order; event_date should be first.
Attempts:
2 left
💡 Hint

Think about how clustering keys order data physically.