ExamGecko
Question list
Search
Search

List of questions

Search

Question 126 - ARA-C01 discussion

Report
Export

A table for IOT devices that measures water usage is created. The table quickly becomes large and contains more than 2 billion rows.

The general query patterns for the table are:

1. DeviceId, lOT_timestamp and Customerld are frequently used in the filter predicate for the select statement

2. The columns City and DeviceManuf acturer are often retrieved

3. There is often a count on Uniqueld

Which field(s) should be used for the clustering key?

A.
lOT_timestamp
Answers
A.
lOT_timestamp
B.
City and DeviceManuf acturer
Answers
B.
City and DeviceManuf acturer
C.
Deviceld and Customerld
Answers
C.
Deviceld and Customerld
D.
Uniqueld
Answers
D.
Uniqueld
Suggested answer: C

Explanation:

A clustering key is a subset of columns or expressions that are used to co-locate the data in the same micro-partitions, which are the units of storage in Snowflake. Clustering can improve the performance of queries that filter on the clustering key columns, as it reduces the amount of data that needs to be scanned. The best choice for a clustering key depends on the query patterns and the data distribution in the table. In this case, the columns DeviceId, IOT_timestamp, and CustomerId are frequently used in the filter predicate for the select statement, which means they are good candidates for the clustering key. The columns City and DeviceManufacturer are often retrieved, but not filtered on, so they are not as important for the clustering key. The column UniqueId is used for counting, but it is not a good choice for the clustering key, as it is likely to have a high cardinality and a uniform distribution, which means it will not help to co-locate the data. Therefore, the best option is to use DeviceId and CustomerId as the clustering key, as they can help to prune the micro-partitions and speed up the queries.Reference:Clustering Keys & Clustered Tables,Micro-partitions & Data Clustering,A Complete Guide to Snowflake Clustering

asked 23/09/2024
Kelvin Galabuzi
37 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first