Bird
0
0

Given the following Bigtable row key design for time-series data: deviceID#timestamp, what will be the order of rows when scanned?

medium📝 service behavior Q13 of 15
GCP - Cloud Firestore and Bigtable
Given the following Bigtable row key design for time-series data: deviceID#timestamp, what will be the order of rows when scanned?
ARows are ordered by deviceID first, then by timestamp ascending.
BRows are ordered by timestamp first, then by deviceID ascending.
CRows are unordered and returned randomly.
DRows are ordered by timestamp descending, then deviceID.
Step-by-Step Solution
Solution:
  1. Step 1: Understand Bigtable row key sorting

    Bigtable sorts rows lexicographically by row key from left to right.
  2. Step 2: Analyze the key format deviceID#timestamp

    Since deviceID is first, rows are grouped by deviceID, then sorted by timestamp ascending within each device.
  3. Final Answer:

    Rows are ordered by deviceID first, then by timestamp ascending. -> Option A
  4. Quick Check:

    Row key order = deviceID then timestamp [OK]
Quick Trick: Row keys sort left to right lex order [OK]
Common Mistakes:
  • Assuming timestamp sorts first
  • Thinking rows are unordered
  • Confusing ascending vs descending order

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes