
Explanation:
The correct data model involves creating a separate metrics table partitioned by timestamp, which allows for efficient querying based on time intervals, ideal for monitoring and analytical purposes. Including a sensorId column in the metrics table to reference the sensors table ensures a clear relationship between the two, facilitating easy joins when necessary. Using an INSERT statement every 30 seconds to append new metrics to the metrics table is the appropriate method for adding new data at regular intervals without impacting existing data.
Other options are less suitable because:
Ultimate access to all questions.
No comments yet.
You are working for a farming company that utilizes a BigQuery table named 'sensors', which is 500 MB in size and contains information on 5000 sensors, including their id, name, and location. The table is updated hourly, and each sensor generates a metric every 30 seconds, complete with a timestamp that needs to be stored in BigQuery. Your task is to choose the most suitable data model for storing these sensor metrics to facilitate weekly analytical queries while minimizing costs. What would be the best approach?
A
B
C
D