How to calculate Timestream query cost?

0

It seems the Timestream pricing has changed and now it is under Timestream for LiveAnalytics and uses concept of TCUs https://aws.amazon.com/timestream/pricing/

Previously we could use data scanned metric to determine query cost, but now the pricing seems to have changed and the answer from 2 years ago doesn't seem to stand anymore: https://repost.aws/questions/QUceLsuOk8Sea076XczWjP9Q/can-the-customer-check-the-average-cost-per-query-in-timestream

Looking at our cost explorer for Timestream, nothing has changed much, but it became more difficult to understand where do our costs come from given the new pricing and difficult to predict what the cost of some of the solutions will be.

I assume scan size still plays a role in determining query cost? It is also unclear how many TCUs are consumed when using query editor in the console. And it is unclear how to predict as to how many TCUs would be consumed for a query.

hRed
asked 15 days ago150 views
2 Answers
2
Accepted Answer

Hlo,

With the introduction of Timestream Query Pricing based on TimeSeries Compute Units (TCUs), understanding and estimating query costs has become more nuanced. While scan size does play a role in determining query cost, it's not the only factor. Here's a breakdown of how query costs are calculated in Timestream:

TimeSeries Compute Units (TCUs): TCUs are the unit of measure for query processing in Timestream. They represent the compute resources consumed by executing queries against Timestream data. The pricing is based on the number of TCUs consumed per query. Query Complexity and Processing: The complexity of the query, including the number of time series and data points scanned, the functions applied, and the duration of the query execution, all contribute to the TCU consumption.

Data Scanned: While not explicitly stated in the pricing documentation, it's reasonable to assume that the amount of data scanned still plays a role in TCU consumption. Queries that scan larger volumes of data may consume more TCUs.

**Query Editor in the Console: **When using the Query Editor in the AWS Management Console, the TCU consumption is not explicitly shown. However, the complexity and data scanned by the query still contribute to the overall TCU consumption, which reflects in the billing.

Predicting TCU Consumption: Predicting the exact TCU consumption for a query can be challenging due to the various factors involved, including query complexity and data distribution. However, you can estimate TCU consumption based on historical query patterns and adjust queries to optimize performance and cost.

**To better understand your Timestream query costs, consider the following steps: ** **Monitor TCU consumption: **Utilize AWS Cost Explorer to monitor TCU consumption and associated costs over time. This can help identify trends and anomalies in query usage.

**Optimize queries: **Review and optimize your queries to reduce complexity and minimize data scanned where possible. Utilize query performance insights provided by Timestream to identify optimization opportunities.

Implement cost controls: Set up AWS Budgets and Cost Allocation Tags to monitor and control Timestream query costs within your budgetary constraints.

answered 15 days ago
profile pictureAWS
EXPERT
reviewed 15 days ago
0

Just wanted to add, since switch to the TCU based pricing for querying, our cost has gone up exponentially. For a few queries yesterday it was $6. We expect to run thousands of ad hoc queries a day, which would make the cost insanely expensive based on these numbers.

Drew
answered 13 days 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