Promo Center

50% off for new user

Direct Mail-46% off

Learn More

FAQ about LindormTSDB

Updated at: 2024-11-07 10:13

This topic provides answers to some frequently asked questions about Lindorm Time Series Database (LindormTSDB) to help you efficiently use LindormTSDB and prevent performance issues that may be caused by improper operations.

Overview

Data writing

Data query

Data deletion

Features and performance

Time series table design

Data writing

What is the optimal method to write data to LindormTSDB?

What is the time precision supported by LindormTSDB?

LindormTSDB supports millisecond-level storage of time data. Higher-precision data is converted into millisecond-precision data for storage. If you write time data that has a higher precision than milliseconds, the precision of the original data is lost.

Which items do I need to take note of when I use the InfluxDB line protocol to write data?

When you use the InfluxDB line protocol to write data to LindormTSDB, take note of the following items:

  • Do not enclose string values of the Tag Key and Tag Value parameters with single quotation marks ('') or double quotation marks (""). By default, the strings are of the STRING type. If you enclose a string in single quotation marks ('') or double quotation marks (""), the quotation marks are considered part of the string.

  • The value of the Field Key parameter (field name) is of the STRING type. Do not enclose a string in single quotation marks ('') or double quotation marks ("").

  • Take note of the data type of the Field Value parameter. If the value of the Field Value parameter is of the STRING type, you must enclose a string in double quotation marks (""). Otherwise, an error is reported. If the value of the Field Value parameter is of the INT type, you must add the i suffix to the number, such as 12i or 101i. Otherwise, the value of the INT type is considered as a value of the FLOAT type.

Why am I unable to query data after I write data to LindormTSDB?

Check whether the time-to-live (TTL) attribute is configured for the data. If the time to write data exceeds the TTL, the written data is deleted. As a result, the query result is empty.

Can I explicitly write NULL to a tag column?

No. You cannot explicitly write NULL to a tag column. Leave the tag column empty when you write data. For example, the sensor table contains the following columns: device_id, region, time, temperature, and humidity. To set the value of the region column to NULL, leave the region column empty. Example: INSERT INTO sensor(device_id, time, temperature, humidity) VALUES ('id123', current_timestamp, 37, 70);.

Data query

What is the recommended query method?

We recommend that you use the Java Database Connectivity (JDBC) driver to connect to LindormTSDB and specify parameters by using a PrepareStatement statement to query data. This reduces the resource usage of the server and improves the query performance. For more information, see Tutorial: Use the JDBC driver for Lindorm to connect to and use LindormTSDB.

What performance issues may occur if I use the ORDER BY LIMIT clause? What other query methods can I use to prevent the issues?

When you use the ORDER BY LIMIT clause to query data, the database sorts the data in memory. If a large amount of data is matched, the server may occupy a large amount of memory, which may compromise stability. To improve query efficiency, we recommend that you reduce the time range for the data query or add tag conditions to minimize the number of data hits during data query.

By default, time series data is returned in ascending order of time in the time series. In this case, you do not need to add the ORDER BY time ASC clause. To query the latest rows of data in a time series table based on the latest point of time in the time series, call the LATEST function instead of using the ORDER BY time DESC clause. For information about the syntax of the LATEST function, see Query the latest values.

Can I specify multiple filter conditions for the same field column in the WHERE clause?

No. You cannot specify multiple filter conditions for the same field column or different field columns.

Data must be read before each filter condition is used to match the value of a field column, which results in low efficiency. In addition, filter conditions cannot be used to match the values of multiple field columns. We recommend that you specify tag columns to filter data.

How do I use COUNT queries to achieve higher efficiency?

Specify a numeric field column for a COUNT query.

What do I do if an error message containing the Metaspace keyword appears when I use Java Native SDK to query data?

When you use Java Native SDK to query data, you must compile SQL statements. This occupies a large amount of metaspace. To query data, we recommend that you use the JDBC driver to connect to LindormTSDB and specify parameters by using PrepareStatement statements. For more information, see Tutorial: Use the JDBC driver for Lindorm to connect to and use LindormTSDB.

Why do the created continuous queries fail to take effect?

A continuous query (CQ) that you created by using the CREATE CONTINUOUS QUERY statement may not take effect due to the following reasons:

  • The table specified by using an INSERT INTO statement is not created.

  • The table specified by using an INSERT INTO statement is created, but the schema of the table is different from the schema specified by using the CREATE CONTINUOUS QUERY statement.

Note

If your LindormTSDB version is 3.4.41 or later, we recommend that you query logs in the LindormTSDB console to troubleshoot the preceding issue.

Why do the queries require an extended period of time?

Check the filter conditions for the queries. If no tag column or time range is specified, the entire table is scanned, which is time consuming.

Data deletion

Can I specify a time range to delete data?

No. You cannot specify a time range to delete data. You can delete data based only on specified tag conditions. You cannot delete data based on field or time conditions.

What are the risks associated with a large number of delete operations?

When LindormTSDB executes delete operations, LindormTSDB adds a delete marker to the data that you want to delete to prevent the data from being queried until the TTL of the data ends and the data is cleared. If a large number of delete requests are submitted, a large number of delete markers are generated, resulting in low query efficiency and degraded background data merging performance. In severe cases, the service may become unavailable.

To regularly clear data, we recommend that you configure the TTL attribute of a table, instead of submitting a large number of delete requests.

Can I delete data based on a specific field?

No. You cannot delete data based on a specific field. If you do not query a field that is no longer required, the query performance is not affected.

Features and performance

Do services restart when I resize a disk?

Disk resizing does not cause processes to restart and does not affect your services.

When does the hot and cold data boundary take effect after being configured?

The cold data archiving process takes place when data is merged in the background. When the data meets the archiving conditions, the entire data is archived in cold storage. To prevent cold data from being frequently merged, LindormTSDB requires the data to be archived in cold storage seven days after the data is written. Therefore, seven days after the data meets the archiving conditions, the cold storage policy (the hot and cold data boundary) takes effect to archive the data in cold storage.

Can I transfer data back to hot storage after I archive the data in cold storage?

No. You cannot transfer data archived in cold storage to hot storage. We recommend that you specify a cold storage duration based on your business requirements. In addition, do not archive frequently queried data in cold storage.

Can I query the disk usage at the table level?

No. You cannot query the storage usage at the table level. You can query the storage usage only at the database level. To query the storage usage at the table level, contact Lindorm technical support (DingTalk number: s0s3eg3).

Why is the compression ratio of LindormTSDB unable to meet expectations?

  • LindormTSDB compresses data of the INT type at a high ratio. If the compression ratio cannot meet your expectations, check whether the test data is of the INT type.

  • The data is written to the memory and logs at the same time. Log data occupies a specific amount of storage space, which affects the overall compression ratio.

  • To ensure a better compression ratio, newly written data must be merged with existing data in the background and then compressed. This process requires more than 10 hours.

Time series table design

Which items do I need to take note of when I design a time series table?

Properly design tags to prevent uncontrollable value ranges of tags. Do not use volatile data, such as time and process ID, as tags of tables. If the volatile tags are used, the number of time series and indexes for the time series increase, which affects query and storage efficiency.

  • On this page (1, T)
  • Overview
  • Data writing
  • Data query
  • Data deletion
  • Features and performance
  • Time series table design
  • Data writing
  • What is the optimal method to write data to LindormTSDB?
  • What is the time precision supported by LindormTSDB?
  • Which items do I need to take note of when I use the InfluxDB line protocol to write data?
  • Why am I unable to query data after I write data to LindormTSDB?
  • Can I explicitly write NULL to a tag column?
  • Data query
  • What is the recommended query method?
  • What performance issues may occur if I use the ORDER BY LIMIT clause? What other query methods can I use to prevent the issues?
  • Can I specify multiple filter conditions for the same field column in the WHERE clause?
  • How do I use COUNT queries to achieve higher efficiency?
  • What do I do if an error message containing the Metaspace keyword appears when I use Java Native SDK to query data?
  • Why do the created continuous queries fail to take effect?
  • Why do the queries require an extended period of time?
  • Data deletion
  • Can I specify a time range to delete data?
  • What are the risks associated with a large number of delete operations?
  • Can I delete data based on a specific field?
  • Features and performance
  • Do services restart when I resize a disk?
  • When does the hot and cold data boundary take effect after being configured?
  • Can I transfer data back to hot storage after I archive the data in cold storage?
  • Can I query the disk usage at the table level?
  • Why is the compression ratio of LindormTSDB unable to meet expectations?
  • Time series table design
  • Which items do I need to take note of when I design a time series table?
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare