Help Center > > Developer Guide

Time Series Ecosystem

Updated at: Jul 14, 2021 GMT+08:00

The TSDB engine provides query capabilities specific to time series scenarios through time series ecosystem functions, facilitating the migration of time series users to GaussDB Kernel.

Time Series Ecosystem Functions

Table 1 Overview

Description

Function

Obtains the timeline based on the tag.

series()

Obtains the column names of all tags.

labels()

Obtains the number of columns of all tags.

labels_count()

series(colname anyelement)

Obtains the timeline based on the tag.

Table 2 Parameter description

Parameter

Type

Description

Required/Option

colname

anyelement

Specifies the tag column to be queried.

Required

  • This function is used to obtain the timeline of a table based on the tag, that is, all combinations of tags.
  • The series function does not scan the entire table. Therefore, use it independently.
Example:
SELECT 
series(tag_col1),
series(tag_col2),
    ....
FROM my_table 
[WHERE tag_att ='XXX']
;

labels(relname name)

Obtains all tag column names based on the table name.

Table 3 Parameter description

Parameter

Type

Description

Required/Option

relname

Name

Name of the table to be queried.

Required

In time series scenarios, tags are used as query conditions. You can properly specify the tag filter conditions to improve query efficiency.

Example:
SELECT labels('my_table');

labels_count(relname name)

Obtains the number of columns of all tags based on the table name.

Table 4 Parameter description

Parameter

Type

Description

Required/Option

relname

Name

Name of the table to be queried.

Required

Example:
SELECT labels_count('my_table');

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel