You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2022/02/11 03:33:02 UTC

[iotdb] 01/01: add doc for tag and attribute

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

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

commit 25cf31d7352a7e726bbc5a75e9f811a0fe2e5cdc
Author: qiaojialin <64...@qq.com>
AuthorDate: Fri Feb 11 11:32:13 2022 +0800

    add doc for tag and attribute
---
 docs/UserGuide/Operate-Metadata/Timeseries.md    | 8 ++++++--
 docs/zh/UserGuide/Operate-Metadata/Timeseries.md | 8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/docs/UserGuide/Operate-Metadata/Timeseries.md b/docs/UserGuide/Operate-Metadata/Timeseries.md
index 35ecfa4..7761abb 100644
--- a/docs/UserGuide/Operate-Metadata/Timeseries.md
+++ b/docs/UserGuide/Operate-Metadata/Timeseries.md
@@ -224,6 +224,12 @@ It costs 0.002s
 ## Tag and Attribute Management
 
 We can also add an alias, extra tag and attribute information while creating one timeseries.
+
+The differences between tag and attribute are:
+
+* Tag could be used to query the path of timeseries, we will maintain an inverted index in memory on the tag: Tag -> Timeseries
+* Attribute could only be queried by timeseries path : Timeseries -> Attribute
+
 The SQL statements for creating timeseries with extra tag and attribute information are extended as follows:
 
 ```
@@ -234,8 +240,6 @@ The `temprature` in the brackets is an alias for the sensor `s1`. So we can use
 
 > IoTDB also supports [using AS function](../Reference/DML-Data-Manipulation-Language.md) to set alias. The difference between the two is: the alias set by the AS function is used to replace the whole time series name, temporary and not bound with the time series; while the alias mentioned above is only used as the alias of the sensor, which is bound with it and can be used equivalent to the original sensor name.
 
-The only difference between tag and attribute is that we will maintain an inverted index on the tag, so we can use tag property in the show timeseries where clause which you can see in the following `Show Timeseries` section.
-
 > Notice that the size of the extra tag and attribute information shouldn't exceed the `tag_attribute_total_size`.
 
 We can update the tag information after creating it as following:
diff --git a/docs/zh/UserGuide/Operate-Metadata/Timeseries.md b/docs/zh/UserGuide/Operate-Metadata/Timeseries.md
index 45cc507..8d2b9d9 100644
--- a/docs/zh/UserGuide/Operate-Metadata/Timeseries.md
+++ b/docs/zh/UserGuide/Operate-Metadata/Timeseries.md
@@ -222,6 +222,12 @@ It costs 0.002s
 ## 标签点管理
 
 我们可以在创建时间序列的时候,为它添加别名和额外的标签和属性信息。
+
+标签和属性的区别在于:
+
+* 标签可以用来查询时间序列路径,会在内存中维护标点到时间序列路径的倒排索引:标签 -> 时间序列路径
+* 属性只能用时间序列路径来查询:时间序列路径 -> 属性
+
 所用到的扩展的创建时间序列的 SQL 语句如下所示:
 ```
 create timeseries root.turbine.d1.s1(temprature) with datatype=FLOAT, encoding=RLE, compression=SNAPPY tags(tag1=v1, tag2=v2) attributes(attr1=v1, attr2=v2)
@@ -232,8 +238,6 @@ create timeseries root.turbine.d1.s1(temprature) with datatype=FLOAT, encoding=R
 
 > IoTDB 同时支持在查询语句中 [使用 AS 函数](../Reference/DML-Data-Manipulation%20Language.md) 设置别名。二者的区别在于:AS 函数设置的别名用于替代整条时间序列名,且是临时的,不与时间序列绑定;而上文中的别名只作为传感器的别名,与其绑定且可与原传感器名等价使用。
 
-标签和属性的唯一差别在于,我们为标签信息在内存中维护了一个倒排索引,所以可以在`show timeseries`的条件语句中使用标签作为查询条件,你将会在下一节看到具体查询内容。
-
 > 注意:额外的标签和属性信息总的大小不能超过`tag_attribute_total_size`.
 
  * 标签点属性更新