You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ha...@apache.org on 2022/10/17 09:00:15 UTC

[iotdb] branch master updated: [IOTDB-4653] add time precision units when setting TTL (#7639)

This is an automated email from the ASF dual-hosted git repository.

haonan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new f33130b9fc [IOTDB-4653] add time precision units when setting TTL (#7639)
f33130b9fc is described below

commit f33130b9fcaf35feef68538fed7f5a5d8724616e
Author: wanghui42 <10...@users.noreply.github.com>
AuthorDate: Mon Oct 17 17:00:09 2022 +0800

    [IOTDB-4653] add time precision units when setting TTL (#7639)
---
 docs/UserGuide/Delete-Data/TTL.md    | 16 ++++++++++++++--
 docs/zh/UserGuide/Delete-Data/TTL.md | 18 ++++++++++++++++--
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/docs/UserGuide/Delete-Data/TTL.md b/docs/UserGuide/Delete-Data/TTL.md
index 52d16072f6..e1c38224d8 100644
--- a/docs/UserGuide/Delete-Data/TTL.md
+++ b/docs/UserGuide/Delete-Data/TTL.md
@@ -23,6 +23,8 @@
 
 IoTDB supports storage-level TTL settings, which means it is able to delete old data automatically and periodically. The benefit of using TTL is that hopefully you can control the total disk space usage and prevent the machine from running out of disks. Moreover, the query performance may downgrade as the total number of files goes up and the memory usage also increase as there are more files. Timely removing such files helps to keep at a high query performance level and reduce memory usage.
 
+The default unit of TTL is milliseconds. If the time precision in the configuration file changes to another, the TTL is still set to milliseconds.
+
 ## Set TTL
 
 The SQL Statement for setting TTL is as follow:
@@ -31,7 +33,7 @@ The SQL Statement for setting TTL is as follow:
 IoTDB> set ttl to root.ln 3600000
 ```
 
-This example means that for data in `root.ln`, only that of the latest 1 hour will remain, the older one is removed or made invisible.
+This example means that for data in `root.ln`, only 3600000 ms, that is, the latest 1 hour will remain, the older one is removed or made invisible.
 
 ```
 IoTDB> set ttl to root.sgcc.** 3600000
@@ -72,7 +74,17 @@ IoTDB> SHOW TTL ON StorageGroupNames
 ```
 
 The SHOW ALL TTL example gives the TTL for all storage groups.
-The SHOW TTL ON  root.group1 , root.group2 , root.group3 example shows the TTL for the three storage 
+The SHOW TTL ON root.ln,root.sgcc,root.DB example shows the TTL for the three storage 
 groups specified.
 Note: the TTL for storage groups that do not have a TTL set will display as null.
 
+```
+IoTDB> show all ttl
++-------------+-------+
+|storage group|ttl(ms)|
++-------------+-------+
+|      root.ln|3600000|
+|    root.sgcc|   null|
+|      root.DB|3600000|
++-------------+-------+
+```
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Delete-Data/TTL.md b/docs/zh/UserGuide/Delete-Data/TTL.md
index 4f76e0b153..2c330a542a 100644
--- a/docs/zh/UserGuide/Delete-Data/TTL.md
+++ b/docs/zh/UserGuide/Delete-Data/TTL.md
@@ -25,13 +25,15 @@ IoTDB 支持对存储组级别设置数据存活时间(TTL),这使得 IoTD
 可以帮助您控制 IoTDB 占用的总磁盘空间以避免出现磁盘写满等异常。并且,随着文件数量的增多,查询性能往往随之下降,
 内存占用也会有所提高。及时地删除一些较老的文件有助于使查询性能维持在一个较高的水平和减少内存资源的占用。
 
+TTL的默认单位为毫秒,如果配置文件中的时间精度修改为其他单位,设置ttl时仍然使用毫秒单位。
+
 ## 设置 TTL
 
 设置 TTL 的 SQL 语句如下所示:
 ```
 IoTDB> set ttl to root.ln 3600000
 ```
-这个例子表示在`root.ln`存储组中,只有最近一个小时的数据将会保存,旧数据会被移除或不可见。
+这个例子表示在`root.ln`存储组中,只有3600000毫秒,即最近一个小时的数据将会保存,旧数据会被移除或不可见。
 ```
 IoTDB> set ttl to root.sgcc.** 3600000
 ```
@@ -71,5 +73,17 @@ IoTDB> SHOW TTL ON StorageGroupNames
 ```
 
 SHOW ALL TTL 这个例子会给出所有存储组的 TTL。
-SHOW TTL ON root.group1,root.group2,root.group3 这个例子会显示指定的三个存储组的 TTL。
+SHOW TTL ON root.ln,root.sgcc,root.DB 这个例子会显示指定的三个存储组的 TTL。
 注意:没有设置 TTL 的存储组的 TTL 将显示为 null。
+
+```
+IoTDB> show all ttl
++-------------+-------+
+|storage group|ttl(ms)|
++-------------+-------+
+|      root.ln|3600000|
+|    root.sgcc|   null|
+|      root.DB|3600000|
++-------------+-------+
+```
+