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?
28 comments · newest first
CO
Cordell
10 months ago
lOT_timestamp makes sense for time-based queries.
ST
Stephaine
10 months ago
I think City and DeviceManufacturer could be useful too.
JU
Justine
10 months ago
Definitely DeviceId and CustomerId for the clustering key.
JO
Jordan
10 months ago
I disagree, Uniqueld doesn't seem relevant for clustering here.
KA
Kaycee
11 months ago
Surprised it got that big! 2 billion rows is insane!
AR
Armanda
11 months ago
I’m leaning towards Uniqueld for the clustering key, but I’m not confident since it’s not mentioned in the filter predicates often.
FE
Felix
11 months ago
I practiced a similar question where we had to choose clustering keys based on query patterns. I think City and DeviceManufacturer might not be the best option here.
TE
Terry
11 months ago
I'm not entirely sure, but I feel like lOT_timestamp could be a good choice since it relates to time-based queries.
WY
Wynell
11 months ago
I remember we discussed clustering keys in class, and I think it might be best to use DeviceId and CustomerId since they are frequently used in filters.
CH
Chery
12 months ago
This is a tricky one, but I think I have a good understanding of the key considerations. I'm going to carefully weigh the pros and cons of each option before making my selection.
TW
Twila
12 months ago
I'm feeling pretty confident about this one. Based on the information provided, I believe the best choice for the clustering key is option A - IOT_timestamp.
TI
Tiera
12 months ago
Okay, I think I've got a strategy here. The clustering key should be based on the frequently used filter predicates, so I'm leaning towards option C - DeviceId and CustomerId.
TO
Torie
1 year ago
Hmm, I'm a bit confused by the question. I'll need to re-read the details and think through the different options before deciding.
AL
Alline
1 year ago
This seems like a tricky one. I'll need to carefully consider the query patterns and how the clustering key can optimize performance.
SH
Shenika
1 year ago
Ooh, this is a tricky one! I'm gonna have to go with C. DeviceId and CustomerID seem like the perfect combo to keep that massive table humming along.
DE
Dell
1 year ago
I think C is the way to go too. It makes sense to use DeviceId and CustomerId for the clustering key.
AL
Alica
1 year ago
I disagree with Rozella, using lOT_timestamp seems more logical for this scenario.
LE
Leota
1 year ago
Haha, UniqueID as the clustering key? That's like trying to use a snowflake as a doorstop - it just doesn't make sense! Gotta go with C on this one.
MA
Marshall
1 year ago
Definitely, using Deviceld and Customerld for the clustering key makes the most sense in this scenario.
HA
Harrison
1 year ago
Yeah, I agree. Deviceld and Customerld seem like the best choice for the clustering key.
EL
Elli
1 year ago
UniqueID as the clustering key? That's like trying to use a snowflake as a doorstop - it just doesn't make sense! Gotta go with C on this one.
RO
Rozella
1 year ago
I believe Deviceld and Customerld should be used for the clustering key.
MA
Maryann
1 year ago
I agree with Veronika, lOT_timestamp makes sense for efficient filtering.
VE
Veronika
1 year ago
I think the clustering key should be lOT_timestamp.
MO
Mollie
1 year ago
I'm torn between B and C. The frequent use of City and DeviceManufacturer is tempting, but the fact that DeviceId and CustomerID are used in the filter predicate makes me lean towards C.
GU
Gussie
1 year ago
For a table with over 2 billion rows, the clustering key should definitely include the frequently used DeviceId and CustomerID. That's a no-brainer!
JU
Judy
1 year ago
B) City and DeviceManufacturer
NI
Nidia
1 year ago
A) lOT_timestamp