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

zhaoxinyi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iotdb-docs.git


The following commit(s) were added to refs/heads/main by this push:
     new f279eea1 Modify other device ttl usage (#407)
f279eea1 is described below

commit f279eea1be036a4ea5cf94a17aeb42daa391501d
Author: shuwenwei <[email protected]>
AuthorDate: Wed Nov 13 11:49:52 2024 +0800

    Modify other device ttl usage (#407)
    
    * update device ttl usage
    
    * modify TTL.md
    
    * modify SQL-Reference.md
    
    * modify SQL-Manual.md
    
    * modify Operate-Metadata_apache.md
    
    * modify Operate-Metadata_timecho.md
---
 src/UserGuide/Master/SQL-Manual/SQL-Manual.md      |   7 +-
 .../Master/User-Manual/Operate-Metadata_apache.md  | 113 ++++++++++-----
 .../Master/User-Manual/Operate-Metadata_timecho.md | 112 ++++++++++-----
 src/UserGuide/Master/stage/Delete-Data/TTL.md      |  49 ++++---
 src/UserGuide/Master/stage/SQL-Reference.md        | 153 +++++++++++++++------
 src/UserGuide/latest/SQL-Manual/SQL-Manual.md      |   7 +-
 .../latest/User-Manual/Operate-Metadata_apache.md  | 113 ++++++++++-----
 .../latest/User-Manual/Operate-Metadata_timecho.md | 112 ++++++++++-----
 src/UserGuide/latest/stage/Delete-Data/TTL.md      |  51 ++++---
 src/UserGuide/latest/stage/SQL-Reference.md        | 153 +++++++++++++++------
 src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md   |  11 +-
 .../Master/User-Manual/Operate-Metadata_apache.md  | 107 +++++++++-----
 .../Master/User-Manual/Operate-Metadata_timecho.md | 106 +++++++++-----
 src/zh/UserGuide/Master/stage/Delete-Data/TTL.md   |  51 ++++---
 src/zh/UserGuide/Master/stage/SQL-Reference.md     | 117 ++++++++++++----
 src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md   |  11 +-
 .../latest/User-Manual/Operate-Metadata_apache.md  | 107 +++++++++-----
 .../latest/User-Manual/Operate-Metadata_timecho.md | 107 +++++++++-----
 src/zh/UserGuide/latest/stage/Delete-Data/TTL.md   |  51 ++++---
 src/zh/UserGuide/latest/stage/SQL-Reference.md     | 117 ++++++++++++----
 20 files changed, 1149 insertions(+), 506 deletions(-)

diff --git a/src/UserGuide/Master/SQL-Manual/SQL-Manual.md 
b/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
index 66f9115f..19b8b79e 100644
--- a/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
+++ b/src/UserGuide/Master/SQL-Manual/SQL-Manual.md
@@ -90,9 +90,9 @@ IoTDB> set ttl to root.** 3600000
 #### Unset TTL
 
 ```sql
-IoTDB> unset ttl to root.ln
-IoTDB> unset ttl to root.sgcc.**
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.ln
+IoTDB> unset ttl from root.sgcc.**
+IoTDB> unset ttl from root.**
 ```
 
 #### Show TTL
@@ -100,6 +100,7 @@ IoTDB> unset ttl to root.**
 ```sql
 IoTDB> SHOW ALL TTL
 IoTDB> SHOW TTL ON StorageGroupNames
+IoTDB> SHOW DEVICES
 ```
 
 ## DEVICE TEMPLATE
diff --git a/src/UserGuide/Master/User-Manual/Operate-Metadata_apache.md 
b/src/UserGuide/Master/User-Manual/Operate-Metadata_apache.md
index a509705c..a3db146b 100644
--- a/src/UserGuide/Master/User-Manual/Operate-Metadata_apache.md
+++ b/src/UserGuide/Master/User-Manual/Operate-Metadata_apache.md
@@ -238,79 +238,116 @@ The query results in each column are as follows:
 
 ### 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.
+IoTDB supports device-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 increases 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.
 
+When setting TTL, the system will look for all devices included in the set 
path and set TTL for these devices. The system will delete expired data at the 
device granularity.
+After the device data expires, it will not be queryable. The data in the disk 
file cannot be guaranteed to be deleted immediately, but it can be guaranteed 
to be deleted eventually.
+However, due to operational costs, the expired data will not be physically 
deleted right after expiring. The physical deletion is delayed until compaction.
+Therefore, before the data is physically deleted, if the TTL is reduced or 
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached, 
some TTL rules need to be deleted before new rules can be set.
+
+#### TTL Path Rule
+The path can only be prefix paths (i.e., the path cannot contain \* , except 
\*\* in the last level).
+This path will match devices and also allows users to specify paths without 
asterisks as specific databases or devices.
+When the path does not contain asterisks, the system will check if it matches 
a database; if it matches a database, both the path and path.\*\* will be set 
at the same time. Note: Device TTL settings do not verify the existence of 
metadata, i.e., it is allowed to set TTL for a non-existent device.
+```
+qualified paths:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+unqualified paths:
+root.*.db
+root.**.db.*
+root.db.*
+```
+#### TTL Applicable Rules
+When a device is subject to multiple TTL rules, the more precise and longer 
rules are prioritized. For example, for the device 
"root.bj.hd.dist001.turbine001", the rule "root.bj.hd.dist001.turbine001" takes 
precedence over "root.bj.hd.dist001.\*\*", and the rule 
"root.bj.hd.dist001.\*\*" takes precedence over "root.bj.hd.**".
 #### Set TTL
-
+The set ttl operation can be understood as setting a TTL rule, for example, 
setting ttl to root.sg.group1.** is equivalent to mounting ttl for all devices 
that can match this path pattern.
+The unset ttl operation indicates unmounting TTL for the corresponding path 
pattern; if there is no corresponding TTL, nothing will be done.
+If you want to set TTL to be infinitely large, you can use the INF keyword.
 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 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
+set ttl to pathPattern 360000;
 ```
-
-It supports setting TTL for databases in a path. This example represents 
setting TTL for all databases in the `root.sgcc` path.
-
-```
-IoTDB> set ttl to root.** 3600000
-```
-
-This example represents setting TTL for all databases.
-
+Set the Time to Live (TTL) to a pathPattern of 360,000 milliseconds; the 
pathPattern should not contain a wildcard (\*) in the middle and must end with 
a double asterisk (\*\*). The pathPattern is used to match corresponding 
devices.
+To maintain compatibility with older SQL syntax, if the user-provided 
pathPattern matches a database (db), the path pattern is automatically expanded 
to include all sub-paths denoted by path.\*\*.
+For instance, writing "set ttl to root.sg 360000" will automatically be 
transformed into "set ttl to root.sg.\*\* 360000", which sets the TTL for all 
devices under root.sg. However, if the specified pathPattern does not match a 
database, the aforementioned logic will not apply. For example, writing "set 
ttl to root.sg.group 360000" will not be expanded to "root.sg.group.\*\*" since 
root.sg.group does not match a database.
+It is also permissible to specify a particular device without a wildcard (*).
 #### Unset TTL
 
 To unset TTL, we can use follwing SQL statement:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
 After unset TTL, all data will be accepted in `root.ln`.
-
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-Unset the TTL setting for all databases in the `root.sgcc` path.
+Unset the TTL in the `root.sgcc` path.
+
+New syntax
+```
+IoTDB> unset ttl from root.**
+```
 
+Old syntax
 ```
 IoTDB> unset ttl to root.**
 ```
+There is no functional difference between the old and new syntax, and they are 
compatible with each other.
+The new syntax is just more conventional in terms of wording.
 
-Unset the TTL setting for all databases.
+Unset the TTL setting for all path pattern.
 
 #### Show TTL
 
 To Show TTL, we can use following SQL statement:
 
+show all ttl
+
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON DataBaseNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-The SHOW ALL TTL example gives the TTL for all databases.
-The SHOW TTL ON root.ln,root.sgcc,root.DB example shows the TTL for the three 
storage 
-groups specified.
-Note: the TTL for databases that do not have a TTL set will display as null.
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+----------+-------+
-| database|ttl(ms)|
-+---------+-------+
-|  root.ln|3600000|
-|root.sgcc|   null|
-|  root.DB|3600000|
-+----------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
 
+The SHOW ALL TTL example gives the TTL for all path patterns.
+The SHOW TTL ON pathPattern shows the TTL for the path pattern specified.
+
+Display devices' ttl
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+All devices will definitely have a TTL, meaning it cannot be null. INF 
represents infinity.
+
 ## Device Template
 
 IoTDB supports the device template function, enabling different entities of 
the same type to share metadata, reduce the memory usage of metadata, and 
simplify the management of numerous entities and measurements.
diff --git a/src/UserGuide/Master/User-Manual/Operate-Metadata_timecho.md 
b/src/UserGuide/Master/User-Manual/Operate-Metadata_timecho.md
index 0621eff0..30cb76aa 100644
--- a/src/UserGuide/Master/User-Manual/Operate-Metadata_timecho.md
+++ b/src/UserGuide/Master/User-Manual/Operate-Metadata_timecho.md
@@ -238,78 +238,116 @@ The query results in each column are as follows:
 
 ### 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.
+IoTDB supports device-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 increases 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.
 
+When setting TTL, the system will look for all devices included in the set 
path and set TTL for these devices. The system will delete expired data at the 
device granularity.
+After the device data expires, it will not be queryable. The data in the disk 
file cannot be guaranteed to be deleted immediately, but it can be guaranteed 
to be deleted eventually.
+However, due to operational costs, the expired data will not be physically 
deleted right after expiring. The physical deletion is delayed until compaction.
+Therefore, before the data is physically deleted, if the TTL is reduced or 
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached, 
some TTL rules need to be deleted before new rules can be set.
+
+#### TTL Path Rule
+The path can only be prefix paths (i.e., the path cannot contain \* , except 
\*\* in the last level).
+This path will match devices and also allows users to specify paths without 
asterisks as specific databases or devices.
+When the path does not contain asterisks, the system will check if it matches 
a database; if it matches a database, both the path and path.\*\* will be set 
at the same time. Note: Device TTL settings do not verify the existence of 
metadata, i.e., it is allowed to set TTL for a non-existent device.
+```
+qualified paths:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+unqualified paths:
+root.*.db
+root.**.db.*
+root.db.*
+```
+#### TTL Applicable Rules
+When a device is subject to multiple TTL rules, the more precise and longer 
rules are prioritized. For example, for the device 
"root.bj.hd.dist001.turbine001", the rule "root.bj.hd.dist001.turbine001" takes 
precedence over "root.bj.hd.dist001.\*\*", and the rule 
"root.bj.hd.dist001.\*\*" takes precedence over "root.bj.hd.**".
 #### Set TTL
-
+The set ttl operation can be understood as setting a TTL rule, for example, 
setting ttl to root.sg.group1.** is equivalent to mounting ttl for all devices 
that can match this path pattern.
+The unset ttl operation indicates unmounting TTL for the corresponding path 
pattern; if there is no corresponding TTL, nothing will be done.
+If you want to set TTL to be infinitely large, you can use the INF keyword.
 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 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
+set ttl to pathPattern 360000;
 ```
-
-It supports setting TTL for databases in a path. This example represents 
setting TTL for all databases in the `root.sgcc` path.
-
-```
-IoTDB> set ttl to root.** 3600000
-```
-
-This example represents setting TTL for all databases.
-
+Set the Time to Live (TTL) to a pathPattern of 360,000 milliseconds; the 
pathPattern should not contain a wildcard (\*) in the middle and must end with 
a double asterisk (\*\*). The pathPattern is used to match corresponding 
devices.
+To maintain compatibility with older SQL syntax, if the user-provided 
pathPattern matches a database (db), the path pattern is automatically expanded 
to include all sub-paths denoted by path.\*\*.
+For instance, writing "set ttl to root.sg 360000" will automatically be 
transformed into "set ttl to root.sg.\*\* 360000", which sets the TTL for all 
devices under root.sg. However, if the specified pathPattern does not match a 
database, the aforementioned logic will not apply. For example, writing "set 
ttl to root.sg.group 360000" will not be expanded to "root.sg.group.\*\*" since 
root.sg.group does not match a database.
+It is also permissible to specify a particular device without a wildcard (*).
 #### Unset TTL
 
 To unset TTL, we can use follwing SQL statement:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
 After unset TTL, all data will be accepted in `root.ln`.
-
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-Unset the TTL setting for all databases in the `root.sgcc` path.
+Unset the TTL in the `root.sgcc` path.
+
+New syntax
+```
+IoTDB> unset ttl from root.**
+```
 
+Old syntax
 ```
 IoTDB> unset ttl to root.**
 ```
+There is no functional difference between the old and new syntax, and they are 
compatible with each other.
+The new syntax is just more conventional in terms of wording.
 
-Unset the TTL setting for all databases.
+Unset the TTL setting for all path pattern.
 
 #### Show TTL
 
 To Show TTL, we can use following SQL statement:
 
+show all ttl
+
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON DataBaseNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-The SHOW ALL TTL example gives the TTL for all databases.
-The SHOW TTL ON root.ln,root.sgcc,root.DB example shows the TTL for the three 
storage 
-groups specified.
-Note: the TTL for databases that do not have a TTL set will display as null.
+show ttl on pathPattern
+```
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
+```
+
+The SHOW ALL TTL example gives the TTL for all path patterns.
+The SHOW TTL ON pathPattern shows the TTL for the path pattern specified.
 
+Display devices' ttl
 ```
-IoTDB> show all ttl
-+----------+-------+
-| database|ttl(ms)|
-+---------+-------+
-|  root.ln|3600000|
-|root.sgcc|   null|
-|  root.DB|3600000|
-+----------+-------+
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
 ```
+All devices will definitely have a TTL, meaning it cannot be null. INF 
represents infinity.
+
 
 ## Device Template
 
diff --git a/src/UserGuide/Master/stage/Delete-Data/TTL.md 
b/src/UserGuide/Master/stage/Delete-Data/TTL.md
index 66270809..c45edf05 100644
--- a/src/UserGuide/Master/stage/Delete-Data/TTL.md
+++ b/src/UserGuide/Master/stage/Delete-Data/TTL.md
@@ -67,45 +67,58 @@ It is also permissible to specify a particular device 
without a wildcard (*).
 To unset TTL, we can use follwing SQL statement:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
 After unset TTL, all data will be accepted in `root.ln`.
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-Unset the TTL setting for all databases in the `root.sgcc` path.
+Unset the TTL in the `root.sgcc` path.
+
+New syntax
+```
+IoTDB> unset ttl from root.**
+```
+
+Old syntax
 ```
 IoTDB> unset ttl to root.**
 ```
+There is no functional difference between the old and new syntax, and they are 
compatible with each other.
+The new syntax is just more conventional in terms of wording.
 
-Unset the TTL setting for all databases.
+Unset the TTL setting for all path pattern.
 
 ## Show TTL
 
 To Show TTL, we can use following SQL statement:
 
+show all ttl
+
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON StorageGroupNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-The SHOW ALL TTL example gives the TTL for all databases.
-The SHOW TTL ON root.ln,root.sgcc,root.DB example shows the TTL for the three 
storage 
-groups specified.
-Note: the TTL for databases that do not have a TTL set will display as null.
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+----------+-------+
-| database|ttl(ms)|
-+---------+-------+
-|  root.ln|3600000|
-|root.sgcc|   null|
-|  root.DB|3600000|
-+----------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
+
+The SHOW ALL TTL example gives the TTL for all path patterns.
+The SHOW TTL ON pathPattern shows the TTL for the path pattern specified.
+
 Display devices' ttl
 ```
 IoTDB> show devices
diff --git a/src/UserGuide/Master/stage/SQL-Reference.md 
b/src/UserGuide/Master/stage/SQL-Reference.md
index 57e70327..aa5f7d83 100644
--- a/src/UserGuide/Master/stage/SQL-Reference.md
+++ b/src/UserGuide/Master/stage/SQL-Reference.md
@@ -1083,50 +1083,115 @@ Note: the statement needs to satisfy this constraint: 
<PrefixPath> + <Path> = <T
 
 ## 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 databases.
-Eg.2 SHOW TTL ON root.group1,root.group2,root.group3
-This example will show TTLs of the specified 3 groups.
-Notice: databases without TTL will show a "null"
-```
-
-Notice: When you set TTL to some databases, 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 words, different from delete 
statement, the
-atomicity of data deletion is not guaranteed for efficiency concerns. So we 
recommend that you do
-not change the TTL once it is set or at least do not reset it frequently, 
unless you are determined 
-to suffer the unpredictability. 
+IoTDB supports device-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 increases 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.
+
+When setting TTL, the system will look for all devices included in the set 
path and set TTL for these devices. The system will delete expired data at the 
device granularity.
+After the device data expires, it will not be queryable. The data in the disk 
file cannot be guaranteed to be deleted immediately, but it can be guaranteed 
to be deleted eventually.
+However, due to operational costs, the expired data will not be physically 
deleted right after expiring. The physical deletion is delayed until compaction.
+Therefore, before the data is physically deleted, if the TTL is reduced or 
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached, 
some TTL rules need to be deleted before new rules can be set.
+
+### TTL Path Rule
+The path can only be prefix paths (i.e., the path cannot contain \* , except 
\*\* in the last level).
+This path will match devices and also allows users to specify paths without 
asterisks as specific databases or devices.
+When the path does not contain asterisks, the system will check if it matches 
a database; if it matches a database, both the path and path.\*\* will be set 
at the same time. Note: Device TTL settings do not verify the existence of 
metadata, i.e., it is allowed to set TTL for a non-existent device.
+```
+qualified paths:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+unqualified paths:
+root.*.db
+root.**.db.*
+root.db.*
+```
+### TTL Applicable Rules
+When a device is subject to multiple TTL rules, the more precise and longer 
rules are prioritized. For example, for the device 
"root.bj.hd.dist001.turbine001", the rule "root.bj.hd.dist001.turbine001" takes 
precedence over "root.bj.hd.dist001.\*\*", and the rule 
"root.bj.hd.dist001.\*\*" takes precedence over "root.bj.hd.**".
+### Set TTL
+The set ttl operation can be understood as setting a TTL rule, for example, 
setting ttl to root.sg.group1.** is equivalent to mounting ttl for all devices 
that can match this path pattern.
+The unset ttl operation indicates unmounting TTL for the corresponding path 
pattern; if there is no corresponding TTL, nothing will be done.
+If you want to set TTL to be infinitely large, you can use the INF keyword.
+The SQL Statement for setting TTL is as follow:
+```
+set ttl to pathPattern 360000;
+```
+Set the Time to Live (TTL) to a pathPattern of 360,000 milliseconds; the 
pathPattern should not contain a wildcard (\*) in the middle and must end with 
a double asterisk (\*\*). The pathPattern is used to match corresponding 
devices.
+To maintain compatibility with older SQL syntax, if the user-provided 
pathPattern matches a database (db), the path pattern is automatically expanded 
to include all sub-paths denoted by path.\*\*.
+For instance, writing "set ttl to root.sg 360000" will automatically be 
transformed into "set ttl to root.sg.\*\* 360000", which sets the TTL for all 
devices under root.sg. However, if the specified pathPattern does not match a 
database, the aforementioned logic will not apply. For example, writing "set 
ttl to root.sg.group 360000" will not be expanded to "root.sg.group.\*\*" since 
root.sg.group does not match a database.
+It is also permissible to specify a particular device without a wildcard (*).
+### Unset TTL
+
+To unset TTL, we can use follwing SQL statement:
+
+```
+IoTDB> unset ttl from root.ln
+```
+
+After unset TTL, all data will be accepted in `root.ln`.
+```
+IoTDB> unset ttl from root.sgcc.**
+```
+
+Unset the TTL in the `root.sgcc` path.
+
+New syntax
+```
+IoTDB> unset ttl from root.**
+```
+
+Old syntax
+```
+IoTDB> unset ttl to root.**
+```
+There is no functional difference between the old and new syntax, and they are 
compatible with each other.
+The new syntax is just more conventional in terms of wording.
+
+Unset the TTL setting for all path pattern.
+
+### Show TTL
+
+To Show TTL, we can use following SQL statement:
+
+show all ttl
+
+```
+IoTDB> SHOW ALL TTL
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
+```
+
+show ttl on pathPattern
+```
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
+```
+
+The SHOW ALL TTL example gives the TTL for all path patterns.
+The SHOW TTL ON pathPattern shows the TTL for the path pattern specified.
+
+Display devices' ttl
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+All devices will definitely have a TTL, meaning it cannot be null. INF 
represents infinity.
 
 * Delete Partition (experimental)
 ```
diff --git a/src/UserGuide/latest/SQL-Manual/SQL-Manual.md 
b/src/UserGuide/latest/SQL-Manual/SQL-Manual.md
index 8548f554..c9076fd6 100644
--- a/src/UserGuide/latest/SQL-Manual/SQL-Manual.md
+++ b/src/UserGuide/latest/SQL-Manual/SQL-Manual.md
@@ -90,9 +90,9 @@ IoTDB> set ttl to root.** 3600000
 #### Unset TTL
 
 ```sql
-IoTDB> unset ttl to root.ln
-IoTDB> unset ttl to root.sgcc.**
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.ln
+IoTDB> unset ttl from root.sgcc.**
+IoTDB> unset ttl from root.**
 ```
 
 #### Show TTL
@@ -100,6 +100,7 @@ IoTDB> unset ttl to root.**
 ```sql
 IoTDB> SHOW ALL TTL
 IoTDB> SHOW TTL ON StorageGroupNames
+IoTDB> SHOW DEVICES
 ```
 
 ## DEVICE TEMPLATE
diff --git a/src/UserGuide/latest/User-Manual/Operate-Metadata_apache.md 
b/src/UserGuide/latest/User-Manual/Operate-Metadata_apache.md
index a509705c..a3db146b 100644
--- a/src/UserGuide/latest/User-Manual/Operate-Metadata_apache.md
+++ b/src/UserGuide/latest/User-Manual/Operate-Metadata_apache.md
@@ -238,79 +238,116 @@ The query results in each column are as follows:
 
 ### 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.
+IoTDB supports device-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 increases 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.
 
+When setting TTL, the system will look for all devices included in the set 
path and set TTL for these devices. The system will delete expired data at the 
device granularity.
+After the device data expires, it will not be queryable. The data in the disk 
file cannot be guaranteed to be deleted immediately, but it can be guaranteed 
to be deleted eventually.
+However, due to operational costs, the expired data will not be physically 
deleted right after expiring. The physical deletion is delayed until compaction.
+Therefore, before the data is physically deleted, if the TTL is reduced or 
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached, 
some TTL rules need to be deleted before new rules can be set.
+
+#### TTL Path Rule
+The path can only be prefix paths (i.e., the path cannot contain \* , except 
\*\* in the last level).
+This path will match devices and also allows users to specify paths without 
asterisks as specific databases or devices.
+When the path does not contain asterisks, the system will check if it matches 
a database; if it matches a database, both the path and path.\*\* will be set 
at the same time. Note: Device TTL settings do not verify the existence of 
metadata, i.e., it is allowed to set TTL for a non-existent device.
+```
+qualified paths:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+unqualified paths:
+root.*.db
+root.**.db.*
+root.db.*
+```
+#### TTL Applicable Rules
+When a device is subject to multiple TTL rules, the more precise and longer 
rules are prioritized. For example, for the device 
"root.bj.hd.dist001.turbine001", the rule "root.bj.hd.dist001.turbine001" takes 
precedence over "root.bj.hd.dist001.\*\*", and the rule 
"root.bj.hd.dist001.\*\*" takes precedence over "root.bj.hd.**".
 #### Set TTL
-
+The set ttl operation can be understood as setting a TTL rule, for example, 
setting ttl to root.sg.group1.** is equivalent to mounting ttl for all devices 
that can match this path pattern.
+The unset ttl operation indicates unmounting TTL for the corresponding path 
pattern; if there is no corresponding TTL, nothing will be done.
+If you want to set TTL to be infinitely large, you can use the INF keyword.
 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 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
+set ttl to pathPattern 360000;
 ```
-
-It supports setting TTL for databases in a path. This example represents 
setting TTL for all databases in the `root.sgcc` path.
-
-```
-IoTDB> set ttl to root.** 3600000
-```
-
-This example represents setting TTL for all databases.
-
+Set the Time to Live (TTL) to a pathPattern of 360,000 milliseconds; the 
pathPattern should not contain a wildcard (\*) in the middle and must end with 
a double asterisk (\*\*). The pathPattern is used to match corresponding 
devices.
+To maintain compatibility with older SQL syntax, if the user-provided 
pathPattern matches a database (db), the path pattern is automatically expanded 
to include all sub-paths denoted by path.\*\*.
+For instance, writing "set ttl to root.sg 360000" will automatically be 
transformed into "set ttl to root.sg.\*\* 360000", which sets the TTL for all 
devices under root.sg. However, if the specified pathPattern does not match a 
database, the aforementioned logic will not apply. For example, writing "set 
ttl to root.sg.group 360000" will not be expanded to "root.sg.group.\*\*" since 
root.sg.group does not match a database.
+It is also permissible to specify a particular device without a wildcard (*).
 #### Unset TTL
 
 To unset TTL, we can use follwing SQL statement:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
 After unset TTL, all data will be accepted in `root.ln`.
-
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-Unset the TTL setting for all databases in the `root.sgcc` path.
+Unset the TTL in the `root.sgcc` path.
+
+New syntax
+```
+IoTDB> unset ttl from root.**
+```
 
+Old syntax
 ```
 IoTDB> unset ttl to root.**
 ```
+There is no functional difference between the old and new syntax, and they are 
compatible with each other.
+The new syntax is just more conventional in terms of wording.
 
-Unset the TTL setting for all databases.
+Unset the TTL setting for all path pattern.
 
 #### Show TTL
 
 To Show TTL, we can use following SQL statement:
 
+show all ttl
+
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON DataBaseNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-The SHOW ALL TTL example gives the TTL for all databases.
-The SHOW TTL ON root.ln,root.sgcc,root.DB example shows the TTL for the three 
storage 
-groups specified.
-Note: the TTL for databases that do not have a TTL set will display as null.
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+----------+-------+
-| database|ttl(ms)|
-+---------+-------+
-|  root.ln|3600000|
-|root.sgcc|   null|
-|  root.DB|3600000|
-+----------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
 
+The SHOW ALL TTL example gives the TTL for all path patterns.
+The SHOW TTL ON pathPattern shows the TTL for the path pattern specified.
+
+Display devices' ttl
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+All devices will definitely have a TTL, meaning it cannot be null. INF 
represents infinity.
+
 ## Device Template
 
 IoTDB supports the device template function, enabling different entities of 
the same type to share metadata, reduce the memory usage of metadata, and 
simplify the management of numerous entities and measurements.
diff --git a/src/UserGuide/latest/User-Manual/Operate-Metadata_timecho.md 
b/src/UserGuide/latest/User-Manual/Operate-Metadata_timecho.md
index 0621eff0..30cb76aa 100644
--- a/src/UserGuide/latest/User-Manual/Operate-Metadata_timecho.md
+++ b/src/UserGuide/latest/User-Manual/Operate-Metadata_timecho.md
@@ -238,78 +238,116 @@ The query results in each column are as follows:
 
 ### 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.
+IoTDB supports device-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 increases 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.
 
+When setting TTL, the system will look for all devices included in the set 
path and set TTL for these devices. The system will delete expired data at the 
device granularity.
+After the device data expires, it will not be queryable. The data in the disk 
file cannot be guaranteed to be deleted immediately, but it can be guaranteed 
to be deleted eventually.
+However, due to operational costs, the expired data will not be physically 
deleted right after expiring. The physical deletion is delayed until compaction.
+Therefore, before the data is physically deleted, if the TTL is reduced or 
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached, 
some TTL rules need to be deleted before new rules can be set.
+
+#### TTL Path Rule
+The path can only be prefix paths (i.e., the path cannot contain \* , except 
\*\* in the last level).
+This path will match devices and also allows users to specify paths without 
asterisks as specific databases or devices.
+When the path does not contain asterisks, the system will check if it matches 
a database; if it matches a database, both the path and path.\*\* will be set 
at the same time. Note: Device TTL settings do not verify the existence of 
metadata, i.e., it is allowed to set TTL for a non-existent device.
+```
+qualified paths:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+unqualified paths:
+root.*.db
+root.**.db.*
+root.db.*
+```
+#### TTL Applicable Rules
+When a device is subject to multiple TTL rules, the more precise and longer 
rules are prioritized. For example, for the device 
"root.bj.hd.dist001.turbine001", the rule "root.bj.hd.dist001.turbine001" takes 
precedence over "root.bj.hd.dist001.\*\*", and the rule 
"root.bj.hd.dist001.\*\*" takes precedence over "root.bj.hd.**".
 #### Set TTL
-
+The set ttl operation can be understood as setting a TTL rule, for example, 
setting ttl to root.sg.group1.** is equivalent to mounting ttl for all devices 
that can match this path pattern.
+The unset ttl operation indicates unmounting TTL for the corresponding path 
pattern; if there is no corresponding TTL, nothing will be done.
+If you want to set TTL to be infinitely large, you can use the INF keyword.
 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 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
+set ttl to pathPattern 360000;
 ```
-
-It supports setting TTL for databases in a path. This example represents 
setting TTL for all databases in the `root.sgcc` path.
-
-```
-IoTDB> set ttl to root.** 3600000
-```
-
-This example represents setting TTL for all databases.
-
+Set the Time to Live (TTL) to a pathPattern of 360,000 milliseconds; the 
pathPattern should not contain a wildcard (\*) in the middle and must end with 
a double asterisk (\*\*). The pathPattern is used to match corresponding 
devices.
+To maintain compatibility with older SQL syntax, if the user-provided 
pathPattern matches a database (db), the path pattern is automatically expanded 
to include all sub-paths denoted by path.\*\*.
+For instance, writing "set ttl to root.sg 360000" will automatically be 
transformed into "set ttl to root.sg.\*\* 360000", which sets the TTL for all 
devices under root.sg. However, if the specified pathPattern does not match a 
database, the aforementioned logic will not apply. For example, writing "set 
ttl to root.sg.group 360000" will not be expanded to "root.sg.group.\*\*" since 
root.sg.group does not match a database.
+It is also permissible to specify a particular device without a wildcard (*).
 #### Unset TTL
 
 To unset TTL, we can use follwing SQL statement:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
 After unset TTL, all data will be accepted in `root.ln`.
-
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-Unset the TTL setting for all databases in the `root.sgcc` path.
+Unset the TTL in the `root.sgcc` path.
+
+New syntax
+```
+IoTDB> unset ttl from root.**
+```
 
+Old syntax
 ```
 IoTDB> unset ttl to root.**
 ```
+There is no functional difference between the old and new syntax, and they are 
compatible with each other.
+The new syntax is just more conventional in terms of wording.
 
-Unset the TTL setting for all databases.
+Unset the TTL setting for all path pattern.
 
 #### Show TTL
 
 To Show TTL, we can use following SQL statement:
 
+show all ttl
+
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON DataBaseNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-The SHOW ALL TTL example gives the TTL for all databases.
-The SHOW TTL ON root.ln,root.sgcc,root.DB example shows the TTL for the three 
storage 
-groups specified.
-Note: the TTL for databases that do not have a TTL set will display as null.
+show ttl on pathPattern
+```
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
+```
+
+The SHOW ALL TTL example gives the TTL for all path patterns.
+The SHOW TTL ON pathPattern shows the TTL for the path pattern specified.
 
+Display devices' ttl
 ```
-IoTDB> show all ttl
-+----------+-------+
-| database|ttl(ms)|
-+---------+-------+
-|  root.ln|3600000|
-|root.sgcc|   null|
-|  root.DB|3600000|
-+----------+-------+
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
 ```
+All devices will definitely have a TTL, meaning it cannot be null. INF 
represents infinity.
+
 
 ## Device Template
 
diff --git a/src/UserGuide/latest/stage/Delete-Data/TTL.md 
b/src/UserGuide/latest/stage/Delete-Data/TTL.md
index 66270809..d539a87c 100644
--- a/src/UserGuide/latest/stage/Delete-Data/TTL.md
+++ b/src/UserGuide/latest/stage/Delete-Data/TTL.md
@@ -59,7 +59,7 @@ The SQL Statement for setting TTL is as follow:
 set ttl to pathPattern 360000;
 ```
 Set the Time to Live (TTL) to a pathPattern of 360,000 milliseconds; the 
pathPattern should not contain a wildcard (\*) in the middle and must end with 
a double asterisk (\*\*). The pathPattern is used to match corresponding 
devices.
-To maintain compatibility with older SQL syntax, if the user-provided 
pathPattern matches a database (db), the path pattern is automatically expanded 
to include all sub-paths denoted by path.\*\*. 
+To maintain compatibility with older SQL syntax, if the user-provided 
pathPattern matches a database (db), the path pattern is automatically expanded 
to include all sub-paths denoted by path.\*\*.
 For instance, writing "set ttl to root.sg 360000" will automatically be 
transformed into "set ttl to root.sg.\*\* 360000", which sets the TTL for all 
devices under root.sg. However, if the specified pathPattern does not match a 
database, the aforementioned logic will not apply. For example, writing "set 
ttl to root.sg.group 360000" will not be expanded to "root.sg.group.\*\*" since 
root.sg.group does not match a database.
 It is also permissible to specify a particular device without a wildcard (*).
 ## Unset TTL
@@ -67,45 +67,58 @@ It is also permissible to specify a particular device 
without a wildcard (*).
 To unset TTL, we can use follwing SQL statement:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
 After unset TTL, all data will be accepted in `root.ln`.
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-Unset the TTL setting for all databases in the `root.sgcc` path.
+Unset the TTL in the `root.sgcc` path.
+
+New syntax
+```
+IoTDB> unset ttl from root.**
+```
+
+Old syntax
 ```
 IoTDB> unset ttl to root.**
 ```
+There is no functional difference between the old and new syntax, and they are 
compatible with each other.
+The new syntax is just more conventional in terms of wording.
 
-Unset the TTL setting for all databases.
+Unset the TTL setting for all path pattern.
 
 ## Show TTL
 
 To Show TTL, we can use following SQL statement:
 
+show all ttl
+
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON StorageGroupNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-The SHOW ALL TTL example gives the TTL for all databases.
-The SHOW TTL ON root.ln,root.sgcc,root.DB example shows the TTL for the three 
storage 
-groups specified.
-Note: the TTL for databases that do not have a TTL set will display as null.
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+----------+-------+
-| database|ttl(ms)|
-+---------+-------+
-|  root.ln|3600000|
-|root.sgcc|   null|
-|  root.DB|3600000|
-+----------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
+
+The SHOW ALL TTL example gives the TTL for all path patterns.
+The SHOW TTL ON pathPattern shows the TTL for the path pattern specified.
+
 Display devices' ttl
 ```
 IoTDB> show devices
diff --git a/src/UserGuide/latest/stage/SQL-Reference.md 
b/src/UserGuide/latest/stage/SQL-Reference.md
index 57e70327..aa5f7d83 100644
--- a/src/UserGuide/latest/stage/SQL-Reference.md
+++ b/src/UserGuide/latest/stage/SQL-Reference.md
@@ -1083,50 +1083,115 @@ Note: the statement needs to satisfy this constraint: 
<PrefixPath> + <Path> = <T
 
 ## 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 databases.
-Eg.2 SHOW TTL ON root.group1,root.group2,root.group3
-This example will show TTLs of the specified 3 groups.
-Notice: databases without TTL will show a "null"
-```
-
-Notice: When you set TTL to some databases, 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 words, different from delete 
statement, the
-atomicity of data deletion is not guaranteed for efficiency concerns. So we 
recommend that you do
-not change the TTL once it is set or at least do not reset it frequently, 
unless you are determined 
-to suffer the unpredictability. 
+IoTDB supports device-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 increases 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.
+
+When setting TTL, the system will look for all devices included in the set 
path and set TTL for these devices. The system will delete expired data at the 
device granularity.
+After the device data expires, it will not be queryable. The data in the disk 
file cannot be guaranteed to be deleted immediately, but it can be guaranteed 
to be deleted eventually.
+However, due to operational costs, the expired data will not be physically 
deleted right after expiring. The physical deletion is delayed until compaction.
+Therefore, before the data is physically deleted, if the TTL is reduced or 
lifted, it may cause data that was previously invisible due to TTL to reappear.
+The system can only set up to 1000 TTL rules, and when this limit is reached, 
some TTL rules need to be deleted before new rules can be set.
+
+### TTL Path Rule
+The path can only be prefix paths (i.e., the path cannot contain \* , except 
\*\* in the last level).
+This path will match devices and also allows users to specify paths without 
asterisks as specific databases or devices.
+When the path does not contain asterisks, the system will check if it matches 
a database; if it matches a database, both the path and path.\*\* will be set 
at the same time. Note: Device TTL settings do not verify the existence of 
metadata, i.e., it is allowed to set TTL for a non-existent device.
+```
+qualified paths:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+unqualified paths:
+root.*.db
+root.**.db.*
+root.db.*
+```
+### TTL Applicable Rules
+When a device is subject to multiple TTL rules, the more precise and longer 
rules are prioritized. For example, for the device 
"root.bj.hd.dist001.turbine001", the rule "root.bj.hd.dist001.turbine001" takes 
precedence over "root.bj.hd.dist001.\*\*", and the rule 
"root.bj.hd.dist001.\*\*" takes precedence over "root.bj.hd.**".
+### Set TTL
+The set ttl operation can be understood as setting a TTL rule, for example, 
setting ttl to root.sg.group1.** is equivalent to mounting ttl for all devices 
that can match this path pattern.
+The unset ttl operation indicates unmounting TTL for the corresponding path 
pattern; if there is no corresponding TTL, nothing will be done.
+If you want to set TTL to be infinitely large, you can use the INF keyword.
+The SQL Statement for setting TTL is as follow:
+```
+set ttl to pathPattern 360000;
+```
+Set the Time to Live (TTL) to a pathPattern of 360,000 milliseconds; the 
pathPattern should not contain a wildcard (\*) in the middle and must end with 
a double asterisk (\*\*). The pathPattern is used to match corresponding 
devices.
+To maintain compatibility with older SQL syntax, if the user-provided 
pathPattern matches a database (db), the path pattern is automatically expanded 
to include all sub-paths denoted by path.\*\*.
+For instance, writing "set ttl to root.sg 360000" will automatically be 
transformed into "set ttl to root.sg.\*\* 360000", which sets the TTL for all 
devices under root.sg. However, if the specified pathPattern does not match a 
database, the aforementioned logic will not apply. For example, writing "set 
ttl to root.sg.group 360000" will not be expanded to "root.sg.group.\*\*" since 
root.sg.group does not match a database.
+It is also permissible to specify a particular device without a wildcard (*).
+### Unset TTL
+
+To unset TTL, we can use follwing SQL statement:
+
+```
+IoTDB> unset ttl from root.ln
+```
+
+After unset TTL, all data will be accepted in `root.ln`.
+```
+IoTDB> unset ttl from root.sgcc.**
+```
+
+Unset the TTL in the `root.sgcc` path.
+
+New syntax
+```
+IoTDB> unset ttl from root.**
+```
+
+Old syntax
+```
+IoTDB> unset ttl to root.**
+```
+There is no functional difference between the old and new syntax, and they are 
compatible with each other.
+The new syntax is just more conventional in terms of wording.
+
+Unset the TTL setting for all path pattern.
+
+### Show TTL
+
+To Show TTL, we can use following SQL statement:
+
+show all ttl
+
+```
+IoTDB> SHOW ALL TTL
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
+```
+
+show ttl on pathPattern
+```
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
+```
+
+The SHOW ALL TTL example gives the TTL for all path patterns.
+The SHOW TTL ON pathPattern shows the TTL for the path pattern specified.
+
+Display devices' ttl
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+All devices will definitely have a TTL, meaning it cannot be null. INF 
represents infinity.
 
 * Delete Partition (experimental)
 ```
diff --git a/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md 
b/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
index 9779f897..ad9e831c 100644
--- a/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
+++ b/src/zh/UserGuide/Master/SQL-Manual/SQL-Manual.md
@@ -341,13 +341,13 @@ IoTDB> set ttl to root.** 3600000
 ```
 #### 取消 TTL
 ```sql
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 ```sql
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 ```sql
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.**
 ```
 
 #### 显示 TTL
@@ -355,7 +355,10 @@ IoTDB> unset ttl to root.**
 IoTDB> SHOW ALL TTL
 ```
 ```sql
-IoTDB> SHOW TTL ON StorageGroupNames
+IoTDB> SHOW TTL ON pathPattern
+```
+```sql
+IoTDB> SHOW DEVICES
 ```
 ## 写入数据
 
diff --git a/src/zh/UserGuide/Master/User-Manual/Operate-Metadata_apache.md 
b/src/zh/UserGuide/Master/User-Manual/Operate-Metadata_apache.md
index a87f2837..15ed2415 100644
--- a/src/zh/UserGuide/Master/User-Manual/Operate-Metadata_apache.md
+++ b/src/zh/UserGuide/Master/User-Manual/Operate-Metadata_apache.md
@@ -138,74 +138,115 @@ Total line number = 1
 It costs 0.002s
 ```
 
-### TTL
+### 数据存活时间(TTL)
 
-IoTDB 支持对 database 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
+IoTDB 支持对 device 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
 可以帮助您控制 IoTDB 占用的总磁盘空间以避免出现磁盘写满等异常。并且,随着文件数量的增多,查询性能往往随之下降,
 内存占用也会有所提高。及时地删除一些较老的文件有助于使查询性能维持在一个较高的水平和减少内存资源的占用。
 
 TTL的默认单位为毫秒,如果配置文件中的时间精度修改为其他单位,设置ttl时仍然使用毫秒单位。
 
+当设置 TTL 时,系统会根据设置的路径寻找所包含的所有 device,并为这些 device 设置 TTL 时间,系统会按设备粒度对过期数据进行删除。
+当设备数据过期后,将不能被查询到,但磁盘文件中的数据不能保证立即删除(会在一定时间内删除),但可以保证最终被删除。
+考虑到操作代价,系统不会立即物理删除超过 TTL 的数据,而是通过合并来延迟地物理删除。因此,在数据被物理删除前,如果调小或者解除 TTL,可能会导致之前因 
TTL 而不可见的数据重新出现。
+系统中仅能设置至多 1000 条 TTL 规则,达到该上限时,需要先删除部分 TTL 规则才能设置新的规则
+
+#### TTL Path 规则
+设置的路径 path 只支持前缀路径(即路径中间不能带 \* , 且必须以 \*\* 结尾),该路径会匹配到设备,也允许用户指定不带星的 path 为具体的 
database 或 device,当 path 不带 \* 时,会检查是否匹配到 database,若匹配到 database,则会同时设置 path 和 
path.\*\*。
+注意:设备 TTL 设置不会对元数据的存在性进行校验,即允许对一条不存在的设备设置 TTL。
+```
+合格的 path:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+不合格的 path:
+root.*.db
+root.**.db.*
+root.db.*
+```
+#### TTL 适用规则
+当一个设备适用多条TTL规则时,优先适用较精确和较长的规则。例如对于设备“root.bj.hd.dist001.turbine001”来说,规则“root.bj.hd.dist001.turbine001”比“root.bj.hd.dist001.\*\*”优先,而规则“root.bj.hd.dist001.\*\*”比“root.bj.hd.\*\*”优先;
 #### 设置 TTL
-
+set ttl 操作可以理解为设置一条 TTL规则,比如 set ttl to root.sg.group1.\*\* 
就相当于对所有可以匹配到该路径模式的设备挂载 ttl。 unset ttl 操作表示对相应路径模式卸载 TTL,若不存在对应 TTL,则不做任何事。若想把 
TTL 调成无限大,则可以使用 INF 关键字
 设置 TTL 的 SQL 语句如下所示:
 ```
-IoTDB> set ttl to root.ln 3600000
-```
-这个例子表示在`root.ln`数据库中,只有3600000毫秒,即最近一个小时的数据将会保存,旧数据会被移除或不可见。
-```
-IoTDB> set ttl to root.sgcc.** 3600000
-```
-支持给某一路径下的 database 设置TTL,这个例子表示`root.sgcc`路径下的所有 database 设置TTL。
-```
-IoTDB> set ttl to root.** 3600000
+set ttl to pathPattern 360000;
 ```
-表示给所有 database 设置TTL。
-
+pathPattern 是前缀路径,即路径中间不能带 \* 且必须以 \*\* 结尾。
+pathPattern 匹配对应的设备。为了兼容老版本 SQL 语法,允许用户输入的 pathPattern 匹配到 db,则自动将前缀路径扩展为 
path.\*\*。
+例如,写set ttl to root.sg 360000 则会自动转化为set ttl to root.sg.\*\* 360000,转化后的语句对所有 
root.sg 下的 device 设置TTL。
+但若写的 pathPattern 无法匹配到 db,则上述逻辑不会生效。
+如写set ttl to root.sg.group 360000 ,由于root.sg.group未匹配到 
db,则不会被扩充为root.sg.group.\*\*。 也允许指定具体 device,不带 \*。
 #### 取消 TTL
 
 取消 TTL 的 SQL 语句如下所示:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
-取消设置 TTL 后, database `root.ln`中所有的数据都会被保存。
+取消设置 TTL 后, `root.ln` 路径下所有的数据都会被保存。
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-取消设置`root.sgcc`路径下的所有 database 的 TTL 。
+取消设置`root.sgcc`路径下的所有的 TTL 。
 ```
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.**
 ```
 
-取消设置所有 database 的 TTL 。
+取消设置所有的 TTL 。
+
+新语法
+```
+IoTDB> unset ttl from root.**
+```
 
+旧语法
+```
+IoTDB> unset ttl to root.**
+```
+新旧语法在功能上没有区别并且同时兼容,仅是新语法在用词上更符合常规。
 #### 显示 TTL
 
 显示 TTL 的 SQL 语句如下所示:
+show all ttl
 
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON DataBaseNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-SHOW ALL TTL 这个例子会给出所有 database 的 TTL。
-SHOW TTL ON root.ln,root.sgcc,root.DB 这个例子会显示指定的三个 database 的 TTL。
-注意:没有设置 TTL 的 database 的 TTL 将显示为 null。
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+-------------+-------+
-|     database|ttl(ms)|
-+-------------+-------+
-|      root.ln|3600000|
-|    root.sgcc|   null|
-|      root.DB|3600000|
-+-------------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
+SHOW ALL TTL 这个例子会给出所有的 TTL。
+SHOW TTL ON pathPattern 这个例子会显示指定路径的 TTL。
 
+显示设备的 TTL。
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+所有设备都一定会有 TTL,即不可能是 null。INF 表示无穷大。
 
 
 ### 设置异构数据库(进阶操作)
diff --git a/src/zh/UserGuide/Master/User-Manual/Operate-Metadata_timecho.md 
b/src/zh/UserGuide/Master/User-Manual/Operate-Metadata_timecho.md
index 836e87bd..db4f524e 100644
--- a/src/zh/UserGuide/Master/User-Manual/Operate-Metadata_timecho.md
+++ b/src/zh/UserGuide/Master/User-Manual/Operate-Metadata_timecho.md
@@ -138,73 +138,115 @@ Total line number = 1
 It costs 0.002s
 ```
 
-### TTL
+### 数据存活时间(TTL)
 
-IoTDB 支持对 database 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
+IoTDB 支持对 device 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
 可以帮助您控制 IoTDB 占用的总磁盘空间以避免出现磁盘写满等异常。并且,随着文件数量的增多,查询性能往往随之下降,
 内存占用也会有所提高。及时地删除一些较老的文件有助于使查询性能维持在一个较高的水平和减少内存资源的占用。
 
 TTL的默认单位为毫秒,如果配置文件中的时间精度修改为其他单位,设置ttl时仍然使用毫秒单位。
 
+当设置 TTL 时,系统会根据设置的路径寻找所包含的所有 device,并为这些 device 设置 TTL 时间,系统会按设备粒度对过期数据进行删除。
+当设备数据过期后,将不能被查询到,但磁盘文件中的数据不能保证立即删除(会在一定时间内删除),但可以保证最终被删除。
+考虑到操作代价,系统不会立即物理删除超过 TTL 的数据,而是通过合并来延迟地物理删除。因此,在数据被物理删除前,如果调小或者解除 TTL,可能会导致之前因 
TTL 而不可见的数据重新出现。
+系统中仅能设置至多 1000 条 TTL 规则,达到该上限时,需要先删除部分 TTL 规则才能设置新的规则
+
+#### TTL Path 规则
+设置的路径 path 只支持前缀路径(即路径中间不能带 \* , 且必须以 \*\* 结尾),该路径会匹配到设备,也允许用户指定不带星的 path 为具体的 
database 或 device,当 path 不带 \* 时,会检查是否匹配到 database,若匹配到 database,则会同时设置 path 和 
path.\*\*。
+注意:设备 TTL 设置不会对元数据的存在性进行校验,即允许对一条不存在的设备设置 TTL。
+```
+合格的 path:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+不合格的 path:
+root.*.db
+root.**.db.*
+root.db.*
+```
+#### TTL 适用规则
+当一个设备适用多条TTL规则时,优先适用较精确和较长的规则。例如对于设备“root.bj.hd.dist001.turbine001”来说,规则“root.bj.hd.dist001.turbine001”比“root.bj.hd.dist001.\*\*”优先,而规则“root.bj.hd.dist001.\*\*”比“root.bj.hd.\*\*”优先;
 #### 设置 TTL
-
+set ttl 操作可以理解为设置一条 TTL规则,比如 set ttl to root.sg.group1.\*\* 
就相当于对所有可以匹配到该路径模式的设备挂载 ttl。 unset ttl 操作表示对相应路径模式卸载 TTL,若不存在对应 TTL,则不做任何事。若想把 
TTL 调成无限大,则可以使用 INF 关键字
 设置 TTL 的 SQL 语句如下所示:
 ```
-IoTDB> set ttl to root.ln 3600000
-```
-这个例子表示在`root.ln`数据库中,只有3600000毫秒,即最近一个小时的数据将会保存,旧数据会被移除或不可见。
-```
-IoTDB> set ttl to root.sgcc.** 3600000
-```
-支持给某一路径下的 database 设置TTL,这个例子表示`root.sgcc`路径下的所有 database 设置TTL。
-```
-IoTDB> set ttl to root.** 3600000
+set ttl to pathPattern 360000;
 ```
-表示给所有 database 设置TTL。
-
+pathPattern 是前缀路径,即路径中间不能带 \* 且必须以 \*\* 结尾。
+pathPattern 匹配对应的设备。为了兼容老版本 SQL 语法,允许用户输入的 pathPattern 匹配到 db,则自动将前缀路径扩展为 
path.\*\*。
+例如,写set ttl to root.sg 360000 则会自动转化为set ttl to root.sg.\*\* 360000,转化后的语句对所有 
root.sg 下的 device 设置TTL。
+但若写的 pathPattern 无法匹配到 db,则上述逻辑不会生效。
+如写set ttl to root.sg.group 360000 ,由于root.sg.group未匹配到 
db,则不会被扩充为root.sg.group.\*\*。 也允许指定具体 device,不带 \*。
 #### 取消 TTL
 
 取消 TTL 的 SQL 语句如下所示:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
-取消设置 TTL 后, database `root.ln`中所有的数据都会被保存。
+取消设置 TTL 后, `root.ln` 路径下所有的数据都会被保存。
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-取消设置`root.sgcc`路径下的所有 database 的 TTL 。
+取消设置`root.sgcc`路径下的所有的 TTL 。
 ```
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.**
 ```
 
-取消设置所有 database 的 TTL 。
+取消设置所有的 TTL 。
+
+新语法
+```
+IoTDB> unset ttl from root.**
+```
 
+旧语法
+```
+IoTDB> unset ttl to root.**
+```
+新旧语法在功能上没有区别并且同时兼容,仅是新语法在用词上更符合常规。
 #### 显示 TTL
 
 显示 TTL 的 SQL 语句如下所示:
+show all ttl
 
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON DataBaseNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-SHOW ALL TTL 这个例子会给出所有 database 的 TTL。
-SHOW TTL ON root.ln,root.sgcc,root.DB 这个例子会显示指定的三个 database 的 TTL。
-注意:没有设置 TTL 的 database 的 TTL 将显示为 null。
+show ttl on pathPattern
+```
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
+```
+SHOW ALL TTL 这个例子会给出所有的 TTL。
+SHOW TTL ON pathPattern 这个例子会显示指定路径的 TTL。
 
+显示设备的 TTL。
 ```
-IoTDB> show all ttl
-+-------------+-------+
-|     database|ttl(ms)|
-+-------------+-------+
-|      root.ln|3600000|
-|    root.sgcc|   null|
-|      root.DB|3600000|
-+-------------+-------+
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
 ```
+所有设备都一定会有 TTL,即不可能是 null。INF 表示无穷大。
 
 
 
diff --git a/src/zh/UserGuide/Master/stage/Delete-Data/TTL.md 
b/src/zh/UserGuide/Master/stage/Delete-Data/TTL.md
index 04792669..3350b147 100644
--- a/src/zh/UserGuide/Master/stage/Delete-Data/TTL.md
+++ b/src/zh/UserGuide/Master/stage/Delete-Data/TTL.md
@@ -66,44 +66,57 @@ pathPattern 匹配对应的设备。为了兼容老版本 SQL 语法,允许用
 取消 TTL 的 SQL 语句如下所示:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
-取消设置 TTL 后, database `root.ln`中所有的数据都会被保存。
+取消设置 TTL 后, `root.ln` 路径下所有的数据都会被保存。
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-取消设置`root.sgcc`路径下的所有 database 的 TTL 。
+取消设置`root.sgcc`路径下的所有的 TTL 。
 ```
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.**
 ```
 
-取消设置所有 database 的 TTL 。
+取消设置所有的 TTL 。
 
+新语法
+```
+IoTDB> unset ttl from root.**
+```
+
+旧语法
+```
+IoTDB> unset ttl to root.**
+```
+新旧语法在功能上没有区别并且同时兼容,仅是新语法在用词上更符合常规。
 ## 显示 TTL
 
 显示 TTL 的 SQL 语句如下所示:
+show all ttl
 
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON StorageGroupNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-SHOW ALL TTL 这个例子会给出所有 database 的 TTL。
-SHOW TTL ON root.ln,root.sgcc,root.DB 这个例子会显示指定的三个 database 的 TTL。
-注意:没有设置 TTL 的 database 的 TTL 将显示为 null。
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+-------------+-------+
-|     database|ttl(ms)|
-+-------------+-------+
-|      root.ln|3600000|
-|    root.sgcc|   null|
-|      root.DB|3600000|
-+-------------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
+SHOW ALL TTL 这个例子会给出所有的 TTL。
+SHOW TTL ON pathPattern 这个例子会显示指定路径的 TTL。
+
 显示设备的 TTL。
 ```
 IoTDB> show devices
diff --git a/src/zh/UserGuide/Master/stage/SQL-Reference.md 
b/src/zh/UserGuide/Master/stage/SQL-Reference.md
index 8e52cbc9..fc7d92f5 100644
--- a/src/zh/UserGuide/Master/stage/SQL-Reference.md
+++ b/src/zh/UserGuide/Master/stage/SQL-Reference.md
@@ -1051,46 +1051,115 @@ Eg. SELECT SUM(temperature) FROM root.ln.wf01.wt01 
WHERE root.ln.wf01.wt01.tempe
 Note: the statement needs to satisfy this constraint: <PrefixPath> + <Path> = 
<Timeseries>
 ```
 
-## TTL
+## 数据存活时间(TTL)
 
-IoTDB 支持对 database 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
+IoTDB 支持对 device 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
 可以帮助您控制 IoTDB 占用的总磁盘空间以避免出现磁盘写满等异常。并且,随着文件数量的增多,查询性能往往随之下降,
 内存占用也会有所提高。及时地删除一些较老的文件有助于使查询性能维持在一个较高的水平和减少内存资源的占用。
-IoTDB 中的 TTL 操作可以由以下的语句进行实现:
 
-* 设置 TTL
+TTL的默认单位为毫秒,如果配置文件中的时间精度修改为其他单位,设置ttl时仍然使用毫秒单位。
 
+当设置 TTL 时,系统会根据设置的路径寻找所包含的所有 device,并为这些 device 设置 TTL 时间,系统会按设备粒度对过期数据进行删除。
+当设备数据过期后,将不能被查询到,但磁盘文件中的数据不能保证立即删除(会在一定时间内删除),但可以保证最终被删除。
+考虑到操作代价,系统不会立即物理删除超过 TTL 的数据,而是通过合并来延迟地物理删除。因此,在数据被物理删除前,如果调小或者解除 TTL,可能会导致之前因 
TTL 而不可见的数据重新出现。
+系统中仅能设置至多 1000 条 TTL 规则,达到该上限时,需要先删除部分 TTL 规则才能设置新的规则
+
+### TTL Path 规则
+设置的路径 path 只支持前缀路径(即路径中间不能带 \* , 且必须以 \*\* 结尾),该路径会匹配到设备,也允许用户指定不带星的 path 为具体的 
database 或 device,当 path 不带 \* 时,会检查是否匹配到 database,若匹配到 database,则会同时设置 path 和 
path.\*\*。
+注意:设备 TTL 设置不会对元数据的存在性进行校验,即允许对一条不存在的设备设置 TTL。
+```
+合格的 path:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+不合格的 path:
+root.*.db
+root.**.db.*
+root.db.*
+```
+### TTL 适用规则
+当一个设备适用多条TTL规则时,优先适用较精确和较长的规则。例如对于设备“root.bj.hd.dist001.turbine001”来说,规则“root.bj.hd.dist001.turbine001”比“root.bj.hd.dist001.\*\*”优先,而规则“root.bj.hd.dist001.\*\*”比“root.bj.hd.\*\*”优先;
+### 设置 TTL
+set ttl 操作可以理解为设置一条 TTL规则,比如 set ttl to root.sg.group1.\*\* 
就相当于对所有可以匹配到该路径模式的设备挂载 ttl。 unset ttl 操作表示对相应路径模式卸载 TTL,若不存在对应 TTL,则不做任何事。若想把 
TTL 调成无限大,则可以使用 INF 关键字
+设置 TTL 的 SQL 语句如下所示:
+```
+set ttl to pathPattern 360000;
+```
+pathPattern 是前缀路径,即路径中间不能带 \* 且必须以 \*\* 结尾。
+pathPattern 匹配对应的设备。为了兼容老版本 SQL 语法,允许用户输入的 pathPattern 匹配到 db,则自动将前缀路径扩展为 
path.\*\*。
+例如,写set ttl to root.sg 360000 则会自动转化为set ttl to root.sg.\*\* 360000,转化后的语句对所有 
root.sg 下的 device 设置TTL。
+但若写的 pathPattern 无法匹配到 db,则上述逻辑不会生效。
+如写set ttl to root.sg.group 360000 ,由于root.sg.group未匹配到 
db,则不会被扩充为root.sg.group.\*\*。 也允许指定具体 device,不带 \*。
+### 取消 TTL
+
+取消 TTL 的 SQL 语句如下所示:
+
+```
+IoTDB> unset ttl from root.ln
+```
+
+取消设置 TTL 后, `root.ln` 路径下所有的数据都会被保存。
 ```
-SET TTL TO StorageGroupName TTLTime
-Eg. SET TTL TO root.group1 3600000
-这个例子展示了如何使得 root.group1 这个 database 只保留近一个小时的数据,一个小时前的数据会被删除或者进入不可见状态。
-注意:TTLTime 应是毫秒时间戳。一旦 TTL 被设置,超过 TTL 时间范围的写入将被拒绝。
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-* 取消 TTL
+取消设置`root.sgcc`路径下的所有的 TTL 。
+```
+IoTDB> unset ttl from root.**
+```
+
+取消设置所有的 TTL 。
+
+新语法
+```
+IoTDB> unset ttl from root.**
+```
 
+旧语法
 ```
-UNSET TTL TO StorageGroupName
-Eg. UNSET TTL TO root.group1
-这个例子展示了如何取消 database root.group1 的 TTL,这将使得该 database 接受任意时刻的数据。
+IoTDB> unset ttl to root.**
 ```
+新旧语法在功能上没有区别并且同时兼容,仅是新语法在用词上更符合常规。
+### 显示 TTL
 
-* 显示 TTL
+显示 TTL 的 SQL 语句如下所示:
+show all ttl
 
 ```
-SHOW ALL TTL
-SHOW TTL ON StorageGroupNames
-Eg.1 SHOW ALL TTL
-这个例子会给出所有 database 的 TTL。
-Eg.2 SHOW TTL ON root.group1,root.group2,root.group3
-这个例子会显示指定的三个 database 的 TTL。
-注意:没有设置 TTL 的 database 的 TTL 将显示为 null。
+IoTDB> SHOW ALL TTL
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-注意:当您对某个 database 设置 TTL 的时候,超过 TTL 范围的数据将会立即不可见。但由于数据文件可能混合包含处在 TTL 范围内
-与范围外的数据,同时数据文件可能正在接受查询,数据文件的物理删除不会立即进行。如果你在此时取消或者调大 TTL,
-一部分之前不可见的数据可能重新可见,而那些已经被物理删除的数据则将永久丢失。也就是说,TTL 操作不会原子性地删除
-对应的数据。因此我们不推荐您频繁修改 TTL,除非您能接受该操作带来的一定程度的不可预知性。
+show ttl on pathPattern
+```
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
+```
+SHOW ALL TTL 这个例子会给出所有的 TTL。
+SHOW TTL ON pathPattern 这个例子会显示指定路径的 TTL。
+
+显示设备的 TTL。
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+所有设备都一定会有 TTL,即不可能是 null。INF 表示无穷大。
 
 * 删除时间分区 (实验性功能)
 
diff --git a/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md 
b/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md
index 9779f897..6da4c878 100644
--- a/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md
+++ b/src/zh/UserGuide/latest/SQL-Manual/SQL-Manual.md
@@ -341,13 +341,13 @@ IoTDB> set ttl to root.** 3600000
 ```
 #### 取消 TTL
 ```sql
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 ```sql
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 ```sql
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.**
 ```
 
 #### 显示 TTL
@@ -355,7 +355,10 @@ IoTDB> unset ttl to root.**
 IoTDB> SHOW ALL TTL
 ```
 ```sql
-IoTDB> SHOW TTL ON StorageGroupNames
+IoTDB> SHOW TTL ON pathPattern
+```
+```sql
+IoTDB> show DEVICES
 ```
 ## 写入数据
 
diff --git a/src/zh/UserGuide/latest/User-Manual/Operate-Metadata_apache.md 
b/src/zh/UserGuide/latest/User-Manual/Operate-Metadata_apache.md
index a87f2837..15ed2415 100644
--- a/src/zh/UserGuide/latest/User-Manual/Operate-Metadata_apache.md
+++ b/src/zh/UserGuide/latest/User-Manual/Operate-Metadata_apache.md
@@ -138,74 +138,115 @@ Total line number = 1
 It costs 0.002s
 ```
 
-### TTL
+### 数据存活时间(TTL)
 
-IoTDB 支持对 database 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
+IoTDB 支持对 device 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
 可以帮助您控制 IoTDB 占用的总磁盘空间以避免出现磁盘写满等异常。并且,随着文件数量的增多,查询性能往往随之下降,
 内存占用也会有所提高。及时地删除一些较老的文件有助于使查询性能维持在一个较高的水平和减少内存资源的占用。
 
 TTL的默认单位为毫秒,如果配置文件中的时间精度修改为其他单位,设置ttl时仍然使用毫秒单位。
 
+当设置 TTL 时,系统会根据设置的路径寻找所包含的所有 device,并为这些 device 设置 TTL 时间,系统会按设备粒度对过期数据进行删除。
+当设备数据过期后,将不能被查询到,但磁盘文件中的数据不能保证立即删除(会在一定时间内删除),但可以保证最终被删除。
+考虑到操作代价,系统不会立即物理删除超过 TTL 的数据,而是通过合并来延迟地物理删除。因此,在数据被物理删除前,如果调小或者解除 TTL,可能会导致之前因 
TTL 而不可见的数据重新出现。
+系统中仅能设置至多 1000 条 TTL 规则,达到该上限时,需要先删除部分 TTL 规则才能设置新的规则
+
+#### TTL Path 规则
+设置的路径 path 只支持前缀路径(即路径中间不能带 \* , 且必须以 \*\* 结尾),该路径会匹配到设备,也允许用户指定不带星的 path 为具体的 
database 或 device,当 path 不带 \* 时,会检查是否匹配到 database,若匹配到 database,则会同时设置 path 和 
path.\*\*。
+注意:设备 TTL 设置不会对元数据的存在性进行校验,即允许对一条不存在的设备设置 TTL。
+```
+合格的 path:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+不合格的 path:
+root.*.db
+root.**.db.*
+root.db.*
+```
+#### TTL 适用规则
+当一个设备适用多条TTL规则时,优先适用较精确和较长的规则。例如对于设备“root.bj.hd.dist001.turbine001”来说,规则“root.bj.hd.dist001.turbine001”比“root.bj.hd.dist001.\*\*”优先,而规则“root.bj.hd.dist001.\*\*”比“root.bj.hd.\*\*”优先;
 #### 设置 TTL
-
+set ttl 操作可以理解为设置一条 TTL规则,比如 set ttl to root.sg.group1.\*\* 
就相当于对所有可以匹配到该路径模式的设备挂载 ttl。 unset ttl 操作表示对相应路径模式卸载 TTL,若不存在对应 TTL,则不做任何事。若想把 
TTL 调成无限大,则可以使用 INF 关键字
 设置 TTL 的 SQL 语句如下所示:
 ```
-IoTDB> set ttl to root.ln 3600000
-```
-这个例子表示在`root.ln`数据库中,只有3600000毫秒,即最近一个小时的数据将会保存,旧数据会被移除或不可见。
-```
-IoTDB> set ttl to root.sgcc.** 3600000
-```
-支持给某一路径下的 database 设置TTL,这个例子表示`root.sgcc`路径下的所有 database 设置TTL。
-```
-IoTDB> set ttl to root.** 3600000
+set ttl to pathPattern 360000;
 ```
-表示给所有 database 设置TTL。
-
+pathPattern 是前缀路径,即路径中间不能带 \* 且必须以 \*\* 结尾。
+pathPattern 匹配对应的设备。为了兼容老版本 SQL 语法,允许用户输入的 pathPattern 匹配到 db,则自动将前缀路径扩展为 
path.\*\*。
+例如,写set ttl to root.sg 360000 则会自动转化为set ttl to root.sg.\*\* 360000,转化后的语句对所有 
root.sg 下的 device 设置TTL。
+但若写的 pathPattern 无法匹配到 db,则上述逻辑不会生效。
+如写set ttl to root.sg.group 360000 ,由于root.sg.group未匹配到 
db,则不会被扩充为root.sg.group.\*\*。 也允许指定具体 device,不带 \*。
 #### 取消 TTL
 
 取消 TTL 的 SQL 语句如下所示:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
-取消设置 TTL 后, database `root.ln`中所有的数据都会被保存。
+取消设置 TTL 后, `root.ln` 路径下所有的数据都会被保存。
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-取消设置`root.sgcc`路径下的所有 database 的 TTL 。
+取消设置`root.sgcc`路径下的所有的 TTL 。
 ```
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.**
 ```
 
-取消设置所有 database 的 TTL 。
+取消设置所有的 TTL 。
+
+新语法
+```
+IoTDB> unset ttl from root.**
+```
 
+旧语法
+```
+IoTDB> unset ttl to root.**
+```
+新旧语法在功能上没有区别并且同时兼容,仅是新语法在用词上更符合常规。
 #### 显示 TTL
 
 显示 TTL 的 SQL 语句如下所示:
+show all ttl
 
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON DataBaseNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-SHOW ALL TTL 这个例子会给出所有 database 的 TTL。
-SHOW TTL ON root.ln,root.sgcc,root.DB 这个例子会显示指定的三个 database 的 TTL。
-注意:没有设置 TTL 的 database 的 TTL 将显示为 null。
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+-------------+-------+
-|     database|ttl(ms)|
-+-------------+-------+
-|      root.ln|3600000|
-|    root.sgcc|   null|
-|      root.DB|3600000|
-+-------------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
+SHOW ALL TTL 这个例子会给出所有的 TTL。
+SHOW TTL ON pathPattern 这个例子会显示指定路径的 TTL。
 
+显示设备的 TTL。
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+所有设备都一定会有 TTL,即不可能是 null。INF 表示无穷大。
 
 
 ### 设置异构数据库(进阶操作)
diff --git a/src/zh/UserGuide/latest/User-Manual/Operate-Metadata_timecho.md 
b/src/zh/UserGuide/latest/User-Manual/Operate-Metadata_timecho.md
index 836e87bd..b8c571bc 100644
--- a/src/zh/UserGuide/latest/User-Manual/Operate-Metadata_timecho.md
+++ b/src/zh/UserGuide/latest/User-Manual/Operate-Metadata_timecho.md
@@ -138,74 +138,115 @@ Total line number = 1
 It costs 0.002s
 ```
 
-### TTL
+### 数据存活时间(TTL)
 
-IoTDB 支持对 database 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
+IoTDB 支持对 device 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
 可以帮助您控制 IoTDB 占用的总磁盘空间以避免出现磁盘写满等异常。并且,随着文件数量的增多,查询性能往往随之下降,
 内存占用也会有所提高。及时地删除一些较老的文件有助于使查询性能维持在一个较高的水平和减少内存资源的占用。
 
 TTL的默认单位为毫秒,如果配置文件中的时间精度修改为其他单位,设置ttl时仍然使用毫秒单位。
 
+当设置 TTL 时,系统会根据设置的路径寻找所包含的所有 device,并为这些 device 设置 TTL 时间,系统会按设备粒度对过期数据进行删除。
+当设备数据过期后,将不能被查询到,但磁盘文件中的数据不能保证立即删除(会在一定时间内删除),但可以保证最终被删除。
+考虑到操作代价,系统不会立即物理删除超过 TTL 的数据,而是通过合并来延迟地物理删除。因此,在数据被物理删除前,如果调小或者解除 TTL,可能会导致之前因 
TTL 而不可见的数据重新出现。
+系统中仅能设置至多 1000 条 TTL 规则,达到该上限时,需要先删除部分 TTL 规则才能设置新的规则
+
+#### TTL Path 规则
+设置的路径 path 只支持前缀路径(即路径中间不能带 \* , 且必须以 \*\* 结尾),该路径会匹配到设备,也允许用户指定不带星的 path 为具体的 
database 或 device,当 path 不带 \* 时,会检查是否匹配到 database,若匹配到 database,则会同时设置 path 和 
path.\*\*。
+注意:设备 TTL 设置不会对元数据的存在性进行校验,即允许对一条不存在的设备设置 TTL。
+```
+合格的 path:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+不合格的 path:
+root.*.db
+root.**.db.*
+root.db.*
+```
+#### TTL 适用规则
+当一个设备适用多条TTL规则时,优先适用较精确和较长的规则。例如对于设备“root.bj.hd.dist001.turbine001”来说,规则“root.bj.hd.dist001.turbine001”比“root.bj.hd.dist001.\*\*”优先,而规则“root.bj.hd.dist001.\*\*”比“root.bj.hd.\*\*”优先;
 #### 设置 TTL
-
+set ttl 操作可以理解为设置一条 TTL规则,比如 set ttl to root.sg.group1.\*\* 
就相当于对所有可以匹配到该路径模式的设备挂载 ttl。 unset ttl 操作表示对相应路径模式卸载 TTL,若不存在对应 TTL,则不做任何事。若想把 
TTL 调成无限大,则可以使用 INF 关键字
 设置 TTL 的 SQL 语句如下所示:
 ```
-IoTDB> set ttl to root.ln 3600000
-```
-这个例子表示在`root.ln`数据库中,只有3600000毫秒,即最近一个小时的数据将会保存,旧数据会被移除或不可见。
-```
-IoTDB> set ttl to root.sgcc.** 3600000
-```
-支持给某一路径下的 database 设置TTL,这个例子表示`root.sgcc`路径下的所有 database 设置TTL。
-```
-IoTDB> set ttl to root.** 3600000
+set ttl to pathPattern 360000;
 ```
-表示给所有 database 设置TTL。
-
+pathPattern 是前缀路径,即路径中间不能带 \* 且必须以 \*\* 结尾。
+pathPattern 匹配对应的设备。为了兼容老版本 SQL 语法,允许用户输入的 pathPattern 匹配到 db,则自动将前缀路径扩展为 
path.\*\*。
+例如,写set ttl to root.sg 360000 则会自动转化为set ttl to root.sg.\*\* 360000,转化后的语句对所有 
root.sg 下的 device 设置TTL。
+但若写的 pathPattern 无法匹配到 db,则上述逻辑不会生效。
+如写set ttl to root.sg.group 360000 ,由于root.sg.group未匹配到 
db,则不会被扩充为root.sg.group.\*\*。 也允许指定具体 device,不带 \*。
 #### 取消 TTL
 
 取消 TTL 的 SQL 语句如下所示:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
-取消设置 TTL 后, database `root.ln`中所有的数据都会被保存。
+取消设置 TTL 后, `root.ln` 路径下所有的数据都会被保存。
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-取消设置`root.sgcc`路径下的所有 database 的 TTL 。
+取消设置`root.sgcc`路径下的所有的 TTL 。
 ```
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.**
 ```
 
-取消设置所有 database 的 TTL 。
+取消设置所有的 TTL 。
+
+新语法
+```
+IoTDB> unset ttl from root.**
+```
 
+旧语法
+```
+IoTDB> unset ttl to root.**
+```
+新旧语法在功能上没有区别并且同时兼容,仅是新语法在用词上更符合常规。
 #### 显示 TTL
 
 显示 TTL 的 SQL 语句如下所示:
+show all ttl
 
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON DataBaseNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-SHOW ALL TTL 这个例子会给出所有 database 的 TTL。
-SHOW TTL ON root.ln,root.sgcc,root.DB 这个例子会显示指定的三个 database 的 TTL。
-注意:没有设置 TTL 的 database 的 TTL 将显示为 null。
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+-------------+-------+
-|     database|ttl(ms)|
-+-------------+-------+
-|      root.ln|3600000|
-|    root.sgcc|   null|
-|      root.DB|3600000|
-+-------------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
+SHOW ALL TTL 这个例子会给出所有的 TTL。
+SHOW TTL ON pathPattern 这个例子会显示指定路径的 TTL。
 
+显示设备的 TTL。
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+所有设备都一定会有 TTL,即不可能是 null。INF 表示无穷大。
 
 
 ### 设置异构数据库(进阶操作)
diff --git a/src/zh/UserGuide/latest/stage/Delete-Data/TTL.md 
b/src/zh/UserGuide/latest/stage/Delete-Data/TTL.md
index 04792669..3350b147 100644
--- a/src/zh/UserGuide/latest/stage/Delete-Data/TTL.md
+++ b/src/zh/UserGuide/latest/stage/Delete-Data/TTL.md
@@ -66,44 +66,57 @@ pathPattern 匹配对应的设备。为了兼容老版本 SQL 语法,允许用
 取消 TTL 的 SQL 语句如下所示:
 
 ```
-IoTDB> unset ttl to root.ln
+IoTDB> unset ttl from root.ln
 ```
 
-取消设置 TTL 后, database `root.ln`中所有的数据都会被保存。
+取消设置 TTL 后, `root.ln` 路径下所有的数据都会被保存。
 ```
-IoTDB> unset ttl to root.sgcc.**
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-取消设置`root.sgcc`路径下的所有 database 的 TTL 。
+取消设置`root.sgcc`路径下的所有的 TTL 。
 ```
-IoTDB> unset ttl to root.**
+IoTDB> unset ttl from root.**
 ```
 
-取消设置所有 database 的 TTL 。
+取消设置所有的 TTL 。
 
+新语法
+```
+IoTDB> unset ttl from root.**
+```
+
+旧语法
+```
+IoTDB> unset ttl to root.**
+```
+新旧语法在功能上没有区别并且同时兼容,仅是新语法在用词上更符合常规。
 ## 显示 TTL
 
 显示 TTL 的 SQL 语句如下所示:
+show all ttl
 
 ```
 IoTDB> SHOW ALL TTL
-IoTDB> SHOW TTL ON StorageGroupNames
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-SHOW ALL TTL 这个例子会给出所有 database 的 TTL。
-SHOW TTL ON root.ln,root.sgcc,root.DB 这个例子会显示指定的三个 database 的 TTL。
-注意:没有设置 TTL 的 database 的 TTL 将显示为 null。
-
+show ttl on pathPattern
 ```
-IoTDB> show all ttl
-+-------------+-------+
-|     database|ttl(ms)|
-+-------------+-------+
-|      root.ln|3600000|
-|    root.sgcc|   null|
-|      root.DB|3600000|
-+-------------+-------+
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
 ```
+SHOW ALL TTL 这个例子会给出所有的 TTL。
+SHOW TTL ON pathPattern 这个例子会显示指定路径的 TTL。
+
 显示设备的 TTL。
 ```
 IoTDB> show devices
diff --git a/src/zh/UserGuide/latest/stage/SQL-Reference.md 
b/src/zh/UserGuide/latest/stage/SQL-Reference.md
index 8e52cbc9..fc7d92f5 100644
--- a/src/zh/UserGuide/latest/stage/SQL-Reference.md
+++ b/src/zh/UserGuide/latest/stage/SQL-Reference.md
@@ -1051,46 +1051,115 @@ Eg. SELECT SUM(temperature) FROM root.ln.wf01.wt01 
WHERE root.ln.wf01.wt01.tempe
 Note: the statement needs to satisfy this constraint: <PrefixPath> + <Path> = 
<Timeseries>
 ```
 
-## TTL
+## 数据存活时间(TTL)
 
-IoTDB 支持对 database 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
+IoTDB 支持对 device 级别设置数据存活时间(TTL),这使得 IoTDB 可以定期、自动地删除一定时间之前的数据。合理使用 TTL
 可以帮助您控制 IoTDB 占用的总磁盘空间以避免出现磁盘写满等异常。并且,随着文件数量的增多,查询性能往往随之下降,
 内存占用也会有所提高。及时地删除一些较老的文件有助于使查询性能维持在一个较高的水平和减少内存资源的占用。
-IoTDB 中的 TTL 操作可以由以下的语句进行实现:
 
-* 设置 TTL
+TTL的默认单位为毫秒,如果配置文件中的时间精度修改为其他单位,设置ttl时仍然使用毫秒单位。
 
+当设置 TTL 时,系统会根据设置的路径寻找所包含的所有 device,并为这些 device 设置 TTL 时间,系统会按设备粒度对过期数据进行删除。
+当设备数据过期后,将不能被查询到,但磁盘文件中的数据不能保证立即删除(会在一定时间内删除),但可以保证最终被删除。
+考虑到操作代价,系统不会立即物理删除超过 TTL 的数据,而是通过合并来延迟地物理删除。因此,在数据被物理删除前,如果调小或者解除 TTL,可能会导致之前因 
TTL 而不可见的数据重新出现。
+系统中仅能设置至多 1000 条 TTL 规则,达到该上限时,需要先删除部分 TTL 规则才能设置新的规则
+
+### TTL Path 规则
+设置的路径 path 只支持前缀路径(即路径中间不能带 \* , 且必须以 \*\* 结尾),该路径会匹配到设备,也允许用户指定不带星的 path 为具体的 
database 或 device,当 path 不带 \* 时,会检查是否匹配到 database,若匹配到 database,则会同时设置 path 和 
path.\*\*。
+注意:设备 TTL 设置不会对元数据的存在性进行校验,即允许对一条不存在的设备设置 TTL。
+```
+合格的 path:
+root.**
+root.db.**
+root.db.group1.**
+root.db
+root.db.group1.d1
+
+不合格的 path:
+root.*.db
+root.**.db.*
+root.db.*
+```
+### TTL 适用规则
+当一个设备适用多条TTL规则时,优先适用较精确和较长的规则。例如对于设备“root.bj.hd.dist001.turbine001”来说,规则“root.bj.hd.dist001.turbine001”比“root.bj.hd.dist001.\*\*”优先,而规则“root.bj.hd.dist001.\*\*”比“root.bj.hd.\*\*”优先;
+### 设置 TTL
+set ttl 操作可以理解为设置一条 TTL规则,比如 set ttl to root.sg.group1.\*\* 
就相当于对所有可以匹配到该路径模式的设备挂载 ttl。 unset ttl 操作表示对相应路径模式卸载 TTL,若不存在对应 TTL,则不做任何事。若想把 
TTL 调成无限大,则可以使用 INF 关键字
+设置 TTL 的 SQL 语句如下所示:
+```
+set ttl to pathPattern 360000;
+```
+pathPattern 是前缀路径,即路径中间不能带 \* 且必须以 \*\* 结尾。
+pathPattern 匹配对应的设备。为了兼容老版本 SQL 语法,允许用户输入的 pathPattern 匹配到 db,则自动将前缀路径扩展为 
path.\*\*。
+例如,写set ttl to root.sg 360000 则会自动转化为set ttl to root.sg.\*\* 360000,转化后的语句对所有 
root.sg 下的 device 设置TTL。
+但若写的 pathPattern 无法匹配到 db,则上述逻辑不会生效。
+如写set ttl to root.sg.group 360000 ,由于root.sg.group未匹配到 
db,则不会被扩充为root.sg.group.\*\*。 也允许指定具体 device,不带 \*。
+### 取消 TTL
+
+取消 TTL 的 SQL 语句如下所示:
+
+```
+IoTDB> unset ttl from root.ln
+```
+
+取消设置 TTL 后, `root.ln` 路径下所有的数据都会被保存。
 ```
-SET TTL TO StorageGroupName TTLTime
-Eg. SET TTL TO root.group1 3600000
-这个例子展示了如何使得 root.group1 这个 database 只保留近一个小时的数据,一个小时前的数据会被删除或者进入不可见状态。
-注意:TTLTime 应是毫秒时间戳。一旦 TTL 被设置,超过 TTL 时间范围的写入将被拒绝。
+IoTDB> unset ttl from root.sgcc.**
 ```
 
-* 取消 TTL
+取消设置`root.sgcc`路径下的所有的 TTL 。
+```
+IoTDB> unset ttl from root.**
+```
+
+取消设置所有的 TTL 。
+
+新语法
+```
+IoTDB> unset ttl from root.**
+```
 
+旧语法
 ```
-UNSET TTL TO StorageGroupName
-Eg. UNSET TTL TO root.group1
-这个例子展示了如何取消 database root.group1 的 TTL,这将使得该 database 接受任意时刻的数据。
+IoTDB> unset ttl to root.**
 ```
+新旧语法在功能上没有区别并且同时兼容,仅是新语法在用词上更符合常规。
+### 显示 TTL
 
-* 显示 TTL
+显示 TTL 的 SQL 语句如下所示:
+show all ttl
 
 ```
-SHOW ALL TTL
-SHOW TTL ON StorageGroupNames
-Eg.1 SHOW ALL TTL
-这个例子会给出所有 database 的 TTL。
-Eg.2 SHOW TTL ON root.group1,root.group2,root.group3
-这个例子会显示指定的三个 database 的 TTL。
-注意:没有设置 TTL 的 database 的 TTL 将显示为 null。
+IoTDB> SHOW ALL TTL
++--------------+--------+
+|          path|     TTL|
+|       root.**|55555555|
+| root.sg2.a.**|44440000|
++--------------+--------+
 ```
 
-注意:当您对某个 database 设置 TTL 的时候,超过 TTL 范围的数据将会立即不可见。但由于数据文件可能混合包含处在 TTL 范围内
-与范围外的数据,同时数据文件可能正在接受查询,数据文件的物理删除不会立即进行。如果你在此时取消或者调大 TTL,
-一部分之前不可见的数据可能重新可见,而那些已经被物理删除的数据则将永久丢失。也就是说,TTL 操作不会原子性地删除
-对应的数据。因此我们不推荐您频繁修改 TTL,除非您能接受该操作带来的一定程度的不可预知性。
+show ttl on pathPattern
+```
+IoTDB> SHOW TTL ON root.db.**;
++--------------+--------+
+|          path|     TTL|
+|    root.db.**|55555555|
+|  root.db.a.**|44440000|
++--------------+--------+
+```
+SHOW ALL TTL 这个例子会给出所有的 TTL。
+SHOW TTL ON pathPattern 这个例子会显示指定路径的 TTL。
+
+显示设备的 TTL。
+```
+IoTDB> show devices
++---------------+---------+---------+
+|         Device|IsAligned|      TTL|
++---------------+---------+---------+
+|root.sg.device1|    false| 36000000|
+|root.sg.device2|     true|      INF|
++---------------+---------+---------+
+```
+所有设备都一定会有 TTL,即不可能是 null。INF 表示无穷大。
 
 * 删除时间分区 (实验性功能)
 

Reply via email to