AWS TimeStream Does TimeUnit influence the Query performance?

0

Hi all,

I'm curious if the TimeUnit on the timestamp affects the query performance. For example I have 1M records saved, and I only care about the minute they where saved ( second and bellow are irrelevant to my application ). Would using the TimeUnit as second or miliseconds make any difference in query performance?

Kind regards, Fazel

Fazel
asked a year ago298 views
1 Answer
0

Yes, the TimeUnit on the timestamp can affect the query performance. If you only care about the minute the records were saved, then using the TimeUnit as second or miliseconds will make a difference in query performance.

When you use a lower TimeUnit, the query engine has to scan more data to find the records that match your criteria. This can lead to slower query performance.

For example, if you have 1M records and you use the TimeUnit as second, the query engine will have to scan 60 times more data than if you used the TimeUnit as minute. This can lead to a significant performance difference, especially for large datasets.

To improve query performance, you should use the highest TimeUnit that is still accurate enough for your application. In your case, since you only care about the minute the records were saved, you should use the TimeUnit as minute.

profile picture
EXPERT
answered a year ago
  • Thanks for your reply,

    How the Query Engine knows the data unit it's querying against if it's configured per-write? One table can have records of different dataUnits, will it use the smallest of all records in the table?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions