jt2594838 commented on a change in pull request #429: [IOTDB-205]Support 
storage-group-level data ttl
URL: https://github.com/apache/incubator-iotdb/pull/429#discussion_r338366796
 
 

 ##########
 File path: docs/Documentation/UserGuide/5-IoTDB SQL Documentation/1-IoTDB 
Query Statement.md
 ##########
 @@ -578,3 +578,48 @@ 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 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 TTL operations in IoTDB are supported by 
the following three
+statements:
+
+* Set TTL
+```
+SET TTL TO StorageGroupName TTLTime
+Eg. SET TTL TO root.group1 3600000
+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 should be millisecond timestamp. When TTL is set, insertions 
that fall
+out of TTL will be rejected.
+```
+
+* Unset TTL
+```
+UNSET TTL TO StorageGroupName
+Eg. UNSET TTL TO root.group1
+This example means that data of all time will be accepted in this group. 
+```
+
+* Show TTL
+```
+SHOW ALL TTL
+SHOW TTL ON StorageGroupNames
+Eg.1 SHOW ALL TTL
+This example will show TTLs of all storage groups.
+Eg.2 SHOW TTL ON root.group1,root.group2,root.group3
+This example will show TTLs of the specified 3 groups.
+```
+
+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. In other word, different from delete 
statement, the
 
 Review comment:
   fixed

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to