Slow query logs
Queries that run during traffic spikes can slow down your Time Series Database (TSDB) instance and affect overall performance. Use the Slow Query Log module in the TSDB console to identify which queries are causing the slowdown.
Prerequisites
Before you begin, make sure that:
The engine version of your TSDB instance is later than V2.6.7. To check your engine version, see View the details of an instance.
Your account has the AliyunHiTSDBReadOnlyAccess permission.
View slow query logs
Log on to the TSDB console.
On the Instances page, find the instance you want to manage and click Manage in the Actions column.
In the left-side navigation pane, choose Time Series Data Management > Slow Query Log.
In the upper-left corner of the Slow query log page, set a time range and click Search. The results show all slow queries run on your TSDB instance within the specified time range.
TSDB records queries that take longer than 1 second to run. Queries under 1 second are not recorded. A query is logged regardless of whether it succeeds or fails — only execution time determines whether it is a slow query.
Log fields
Each slow query log entry contains the following fields.
| Field | Description |
|---|---|
| Execution time | How long the query took to run on TSDB. |
| Log time | When the slow query was recorded. |
| Statement | The query conditions received by TSDB, shown in deserialized form. The actual statement you ran may contain additional internal fields. |
| Source IP | The IP address of the client that sent the query. If your TSDB instance is deployed in a virtual private cloud (VPC), this is typically a private IP address. |
What's next
After you identify slow queries, take the following steps to improve query performance: