All Products
Search
Document Center

TSQL overview

Last Updated: May 19, 2022

TSQL is a structured query language that is used to manage time series data. TSQL is provided by Alibaba Cloud Time Series Database (TSDB). TSQL allows you to use the SQL syntax to read data. This way, you can access data in an easy manner and improve the computing capabilities of your database. This topic describes the key features and benefits of TSQL.

SQL queries

TSQL can convert time series data into structured data by mapping metrics to relational data tables and mapping tags, metric values, and timestamps to corresponding columns in a relational database. You can create SQL query statements in which tables and columns are specified to query, filter, and compute time series data.

OpenTSDB is an open source database service that allows you to query time series data only by using RESTful API operations. This results in high learning costs and inconvenience. TSQL provides a simpler method for querying data than OpenTSDB. This helps SQL developers develop time series databases in an easier manner.

Time series data queries based on JOIN operations

TSQL supports JOIN operations. You can perform JOIN operations to query data that contains the same tag and timestamp for association analysis. TSQL allows you to query multiple metrics and join the metric values in the query results.

OpenTSDB allows you to query only one metric in each subquery. You cannot use OpenTSDB to query multiple metrics for association analysis. To query multiple metrics for association analysis, you must align timestamps and time series data. TSQL provides an easy method for querying multiple metrics. If you use TSQL to query multiple metrics, TSQL automatically aligns timestamps and time series data. This helps you reduce service development costs and meet the business requirements for multi-metric queries.

Support for the standard SQL and time series data computing

TSQL enhances the computing capabilities of the standard SQL. TSQL is compatible with native SQL functions. TSQL also supports precision compute functions that are specific to time series data. You can use these precision compute functions to downsample and aggregate data.

Time series data computing based on multiple metrics

TSQL allows you to perform complex computing operations on multiple columns. You can perform computing operations on multiple fields of metrics when you query data from databases. This can help meet your complex business requirements for computing.