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_r339506904
########## File path: docs/Documentation-CHN/UserGuide/4-Operation Manual/7-IoTDB Query Language.md ########## @@ -475,6 +475,43 @@ 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操作通可以由以下的语句进行实现: + +* 设置 TTL +``` +SET TTL TO StorageGroupName TTLTime +Eg. SET TTL TO root.group1 3600000 +这个例子展示了如何使得root.group1这个存储组只保留近一个小时的数据,一个小时前的数据会被删除或者进入不可见状态。 +注意: TTLTime 应是毫秒时间戳。一旦TTL被设置,超过TTL时间范围的写入将被拒绝。 +``` + +* 取消 TTL +``` +UNSET TTL TO StorageGroupName +Eg. UNSET TTL TO root.group1 +这个例子展示了如何取消存储组root.group1的TTL,这将使得该存储组接受任意时刻的数据。 +``` + +* 显示 TTL +``` +SHOW ALL TTL Review comment: Changed. ---------------------------------------------------------------- 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
