Athena federated query to Timestream slow

0

We connected Timestream to Athena using the Athena Timestream connector. When running a federated query through Athena to Timestream, performance is 7x slower than querying Timestream directly. Simple, sub-second queries in Timestream take a minimum of 7 seconds to return in Athena. Is there anyway to improve Athena's federated query performance? We could connect directly to Timestream's JDBC driver, but it would require additional work and won't allow joining across AWS products through Athena, like we had hoped to do.

In a similar vein, is it possible to use Glue to connect Timestream to Athena more directly? Or is the federated query connection still required even if using Glue?

Drew
asked 3 months ago743 views
2 Answers
0

Rearranging the tables in the join to better align with the WHERE clause can often result in a more efficient query plan, significantly reducing the runtime. Using Athena's EXPLAIN feature can help you identify inefficiencies in your query's execution plan. For example, making sure the join operations are performed in the correct order can have a substantial impact on performance. A suboptimal join order may result in unnecessary data processing and longer execution times.

https://aws.amazon.com/blogs/big-data/optimize-federated-query-performance-using-explain-and-explain-analyze-in-amazon-athena/

Additional metadata from AWS Glue Data Catalog may be used to optimize queries; AWS Glue database and table names must match those in Timestream; lowercase names are preferred for optimal performance; mixed case names result in more computationally intensive searches; setting AWS Glue table properties in accordance with Timestream requirements can also improve performance.

https://docs.aws.amazon.com/athena/latest/ug/connectors-timestream.html

https://docs.amazonaws.cn/en_us/athena/latest/ug/connectors-timestream.html

profile picture
EXPERT
answered 3 months ago
0

Appreciate the response. No joins are being used here, this is just a straight query to Timestream with a simple predicate that matches the timestream db.

We will integrate into Glue as well and see if that helps improve performance.

Drew
answered 3 months ago

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