- Newest
- Most votes
- Most comments
Choosing the 'right' dimensions is important for query performance in Amazon Timestream because it allows the service to optimize how it stores and retrieves data. When ingesting data, Timestream partitions and stores the records based on the dimensions specified.
During a query with a WHERE clause filtering on one of these dimensions, Timestream quickly identifies the exact partitions to scan rather than having to scan all the data. This is kind of like how a B-Tree index in a relational database allows for fast lookups and retrieval of records based on indexed columns.
Things to Consider
-
Timestream stores records within internal partitions based on the ingestion dimensions like customer ID, device ID, etc.
-
When a query filters on one of these dimensions, Timestream knows the exact partitions to scan rather than a full table scan. (It's quicker!)
-
This partition-level filtering enables Timestream to achieve high query performance even for very large datasets as it doesn't have to scan irrelevant partitions.
-
In contrast, filtering only on measure columns would require a full table scan as Timestream doesn't have the dimension context to narrow down the partitions.
Reference -
AWS TimeStream Does TimeUnit influence the Query performance?
Introducing customer-defined partition keys for Amazon Timestream: Optimizing query performance
Relevant content
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 months ago