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

jiangtian pushed a commit to branch dev_TTL
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git


The following commit(s) were added to refs/heads/dev_TTL by this push:
     new db6268a  add docs
db6268a is described below

commit db6268a403b2ce05d5124990d2a9a51c14daf998
Author: jt <[email protected]>
AuthorDate: Tue Sep 17 21:26:15 2019 +0800

    add docs
---
 .../1-IoTDB Query Statement.md                     | 26 +++++++++++++++++
 .../1-IoTDB Query Statement.md                     | 33 ++++++++++++++++++++++
 2 files changed, 59 insertions(+)

diff --git a/docs/Documentation-CHN/UserGuide/5-IoTDB SQL Documentation/1-IoTDB 
Query Statement.md b/docs/Documentation-CHN/UserGuide/5-IoTDB SQL 
Documentation/1-IoTDB Query Statement.md
index 44ddc82..3a66444 100644
--- a/docs/Documentation-CHN/UserGuide/5-IoTDB SQL Documentation/1-IoTDB Query 
Statement.md     
+++ b/docs/Documentation-CHN/UserGuide/5-IoTDB SQL Documentation/1-IoTDB Query 
Statement.md     
@@ -475,3 +475,29 @@ SELECT SUM(Path) (COMMA SUM(Path))* FROM <FromClause> 
[WHERE <WhereClause>]?
 Eg. SELECT SUM(temperature) FROM root.ln.wf01.wt01 WHERE 
root.ln.wf01.wt01.temperature < 24
 Note: the statement needs to satisfy this constraint: <PrefixPath> + <Path> = 
<Timeseries>
 ```
+
+### TTL
+IoTDB支持对存储组级别设置数据存活时间(TTL),这使得IoTDB可以定期、自动地删除一定时间之前的数据。合理使用TTL
+可以帮助您控制IoTDB占用的总磁盘空间以避免出现磁盘写满等异常。并且,随着文件数量的增多,查询性能往往随之下降。
+及时地删除一些较老的文件有助于使得查询性能维持在一个较高的水平。IoTDB中的TTL操作通过以下的语句进行支持:
+
+* Set TTL
+```
+SET TTL TO StorageGroupName TTLTime
+Eg.1 SET TTL TO root.group1 3600000
+Eg.2 SET TTL TO root.group1 1h
+这个例子展示了如何使得root.group1这个存储组只保留近一个小时的数据,一个小时前的数据会被删除或者进入不可见状态。
+Note: TTLTime 可以是毫秒时间戳或是日期格式。一旦TTL被设置,超过TTL时间范围的写入将被拒绝。
+```
+
+* Unset TTL
+```
+UNSET TTL TO StorageGroupName
+Eg.1 UNSET TTL TO root.group1
+这个例子展示了如何取消存储组root.group1的TTL,这将使得该存储组接受任意时刻的数据。
+```
+
+注意:当你对某个存储组设置TTL的时候,超过TTL范围的数据将会立即不可见。但由于数据文件可能混合包含处在TTL范围内
+与范围外的数据,同时数据文件可能正在接受查询,数据文件的物理删除不会立即进行。如果你在此时取消或者调大TTL,
+一部分之前不可见的数据可能重新可见,而那些已经被物理删除的数据则将永久丢失。因此我们不推荐您修改或是频繁修改TTL,
+除非您能接受该操作带来的一定程度的不可预知性。
\ No newline at end of file
diff --git a/docs/Documentation/UserGuide/5-IoTDB SQL Documentation/1-IoTDB 
Query Statement.md b/docs/Documentation/UserGuide/5-IoTDB SQL 
Documentation/1-IoTDB Query Statement.md
index 9b34bb4..733fc3f 100644
--- a/docs/Documentation/UserGuide/5-IoTDB SQL Documentation/1-IoTDB Query 
Statement.md 
+++ b/docs/Documentation/UserGuide/5-IoTDB SQL Documentation/1-IoTDB Query 
Statement.md 
@@ -501,3 +501,36 @@ SELECT SUM(Path) (COMMA SUM(Path))* FROM <FromClause> 
[WHERE <WhereClause>]?
 Eg. SELECT SUM(temperature) FROM root.ln.wf01.wt01 WHERE 
root.ln.wf01.wt01.temperature < 24
 Note: the statement needs to satisfy this constraint: <PrefixPath> + <Path> = 
<Timeseries>
 ```
+
+### TTL
+IoTDB supports storage-level TTL settings, which means it is able to delete 
old data
+automatically and periodically. The beneficial of using TTL is that hopefully 
you can control the 
+total disk space usage to prevent the machine from running out of disk. 
Moreover, the query
+performance may downgrade as the total number of files goes up. Timely 
removing such files also
+helps to keep at a high query performance level. The TTL operations in IoTDB 
are supported by the
+following two statements:
+
+* Set TTL
+```
+SET TTL TO StorageGroupName TTLTime
+Eg.1 SET TTL TO root.group1 3600000
+Eg.2 SET TTL TO root.group1 1h
+This example means that for data in root.group1, only that of the latest 1 
hour will remain, the
+older one is removed or made invisible. 
+Note: TTLTime can be millisecond timestamp or date format. When TTL is set, 
insertions that fall
+out of TTL will be rejected.
+```
+
+* Unset TTL
+```
+UNSET TTL TO StorageGroupName
+Eg.1 UNSET TTL TO root.group1
+This example means that data of all time will be stored in this group. 
+```
+
+Notice: When you set TTL to some storage groups, data out of the TTL will be 
made invisible
+immediately, but because the data files may contain both out-dated and living 
data or the data files may
+be being used by queries, the physical removal of data is stale. If you 
increase or unset TTL
+just after setting it previously, some previously invisible data may be seen 
again, but the
+physically removed one is lost forever. So we recommend that you do not change 
the TTL once it is
+set or do not reset it frequently, unless you are determined to suffer this 
unpredictability. 
\ No newline at end of file

Reply via email to