This is an automated email from the ASF dual-hosted git repository.
jackietien 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 2cc8f72 Add more description about last query, slow query and CQ
2cc8f72 is described below
commit 2cc8f72b02001556320bbbd9d31f4f1d1f2629ab
Author: Jackie Tien <[email protected]>
AuthorDate: Mon Jul 31 21:49:08 2023 +0800
Add more description about last query, slow query and CQ
---
src/.vuepress/sidebar/V1.1.x/zh.ts | 1 +
src/.vuepress/sidebar/V1.2.x/zh.ts | 1 +
src/.vuepress/sidebar_timecho/V1.1.x/zh.ts | 1 +
src/.vuepress/sidebar_timecho/V1.2.x/zh.ts | 1 +
.../V1.2.x/Query-Data/Continuous-Query.md | 2 ++
src/UserGuide/V1.2.x/Query-Data/Overview.md | 4 ++-
.../Slow-Query-Management.md | 35 ++++++++++++++++++++++
.../Master/Query-Data/Continuous-Query.md | 2 ++
src/zh/UserGuide/Master/Query-Data/Overview.md | 2 +-
.../Master/User-Manuel/Database-Programming.md | 2 ++
.../{Query-Data => User-Manuel}/Last-Query.md | 14 ++++++++-
src/zh/UserGuide/Master/User-Manuel/Query-Data.md | 4 ++-
.../Maintenance-Tools/Slow-Query-Management.md | 35 ++++++++++++++++++++++
.../V1.1.x/Query-Data/Continuous-Query.md | 2 ++
src/zh/UserGuide/V1.1.x/Query-Data/Last-Query.md | 14 ++++++++-
src/zh/UserGuide/V1.1.x/Query-Data/Overview.md | 4 ++-
.../Slow-Query-Management.md | 35 ++++++++++++++++++++++
.../V1.2.x/Query-Data/Continuous-Query.md | 2 ++
src/zh/UserGuide/V1.2.x/Query-Data/Overview.md | 6 ++--
.../V1.2.x/User-Manuel/Database-Programming.md | 2 ++
.../{Query-Data => User-Manuel}/Last-Query.md | 15 +++++++++-
src/zh/UserGuide/V1.2.x/User-Manuel/Query-Data.md | 4 ++-
22 files changed, 178 insertions(+), 10 deletions(-)
diff --git a/src/.vuepress/sidebar/V1.1.x/zh.ts
b/src/.vuepress/sidebar/V1.1.x/zh.ts
index 1e8441f..4a8f1da 100644
--- a/src/.vuepress/sidebar/V1.1.x/zh.ts
+++ b/src/.vuepress/sidebar/V1.1.x/zh.ts
@@ -236,6 +236,7 @@ export const zhSidebar = {
{ text: 'TsFile 拆分工具', link: 'TsFile-Split-Tool' },
{ text: 'TsFile 导入导出工具', link: 'TsFile-Load-Export-Tool' },
{ text: 'CSV 导入导出工具', link: 'CSV-Tool' },
+ { text: '慢查询管理', link: 'Slow-Query-Management' },
],
},
{
diff --git a/src/.vuepress/sidebar/V1.2.x/zh.ts
b/src/.vuepress/sidebar/V1.2.x/zh.ts
index 99bebe2..7052b12 100644
--- a/src/.vuepress/sidebar/V1.2.x/zh.ts
+++ b/src/.vuepress/sidebar/V1.2.x/zh.ts
@@ -69,6 +69,7 @@ export const zhSidebar = {
{ text: '部署指导', link: 'Deployment-Guide' },
{ text: 'docker部署', link: 'Docker-Install' },
{ text: '安全控制', link: 'Security-Management' },
+ { text: '慢查询管理', link: 'Slow-Query-Management' },
],
},
diff --git a/src/.vuepress/sidebar_timecho/V1.1.x/zh.ts
b/src/.vuepress/sidebar_timecho/V1.1.x/zh.ts
index 5a2aa71..3df2d33 100644
--- a/src/.vuepress/sidebar_timecho/V1.1.x/zh.ts
+++ b/src/.vuepress/sidebar_timecho/V1.1.x/zh.ts
@@ -77,6 +77,7 @@ export const zhSidebar = {
{ text: '部署指导', link: 'Deployment-Guide' },
{ text: 'docker部署', link: 'Docker-Install' },
{ text: '安全控制', link: 'Security-Management' },
+ { text: '慢查询管理', link: 'Slow-Query-Management' },
],
},
diff --git a/src/.vuepress/sidebar_timecho/V1.2.x/zh.ts
b/src/.vuepress/sidebar_timecho/V1.2.x/zh.ts
index acd7e58..b68ec07 100644
--- a/src/.vuepress/sidebar_timecho/V1.2.x/zh.ts
+++ b/src/.vuepress/sidebar_timecho/V1.2.x/zh.ts
@@ -69,6 +69,7 @@ export const zhSidebar = {
{ text: '部署指导', link: 'Deployment-Guide' },
{ text: 'docker部署', link: 'Docker-Install' },
{ text: '安全控制', link: 'Security-Management' },
+ { text: '慢查询管理', link: 'Slow-Query-Management' },
],
},
diff --git a/src/UserGuide/V1.2.x/Query-Data/Continuous-Query.md
b/src/UserGuide/V1.2.x/Query-Data/Continuous-Query.md
index a31216c..f1732b4 100644
--- a/src/UserGuide/V1.2.x/Query-Data/Continuous-Query.md
+++ b/src/UserGuide/V1.2.x/Query-Data/Continuous-Query.md
@@ -24,6 +24,8 @@
## Introduction
Continuous queries(CQ) are queries that run automatically and periodically on
realtime data and store query results in other specified time series.
+Users can implement sliding window streaming computing through continuous
query, such as calculating the hourly average temperature of a time series and
writing it into a new time series. Users can also customize the `RESAMPLE`
clause to create different sliding windows, which can achieve a certain degree
of tolerance for out-of-order data.
+
## Syntax
```sql
diff --git a/src/UserGuide/V1.2.x/Query-Data/Overview.md
b/src/UserGuide/V1.2.x/Query-Data/Overview.md
index d2357e2..bbb16b8 100644
--- a/src/UserGuide/V1.2.x/Query-Data/Overview.md
+++ b/src/UserGuide/V1.2.x/Query-Data/Overview.md
@@ -23,7 +23,7 @@
## Syntax Definition
-In IoTDB, `SELECT` statement is used to retrieve data from one or more
selected time series. Here is the syntax definition of `SELECT` statement:
+In IoTDB, `SELECT` statement is used to retrieve data from one or more
selected time series. IoTDB does not distinguish between historical data and
real-time data. Users can use unified sql syntax to query, and determine the
time range of the query through the time filter predicate in the `WHERE`
clause. Here is the syntax definition of `SELECT` statement:
```sql
SELECT [LAST] selectExpr [, selectExpr] ...
@@ -119,6 +119,8 @@ SELECT [LAST] selectExpr [, selectExpr] ...
## Basic Examples
+IoTDB supports ad-hoc queries, that is, users can customize query conditions
while using the system, and write and execute query sql according to their
needs at that time. Users can combine the clauses introduced above to specify
any legal filter conditions to meet the query requirements at that time. Some
query examples are introduced below:
+
### Select a Column of Data Based on a Time Interval
The SQL statement is:
diff --git
a/src/zh/UserGuide/Master/Deployment-and-Maintenance/Slow-Query-Management.md
b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Slow-Query-Management.md
new file mode 100644
index 0000000..f2348f2
--- /dev/null
+++
b/src/zh/UserGuide/Master/Deployment-and-Maintenance/Slow-Query-Management.md
@@ -0,0 +1,35 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+# 慢查询管理
+
+IoTDB 会将慢查询输出到单独的日志文件 log_datanode_slow_sql.log 中,并记录其执行耗时。
+
+## 配置慢查询的阈值
+
+IoTDB 在 `iotdb-common.properties` 提供了 `slow_query_threshold`
配置项,单位是毫秒,默认是30秒,超过此参数指定的阈值,便会被判断为慢查询,待其查询执行结束后,将其记录在 log_datanode_slow_sql.log
中。
+
+## 慢查询日志示例
+
+```
+2023-07-31 20:15:00,533
[pool-27-IoTDB-ClientRPC-Processor-1$20230731_121500_00003_1] INFO
o.a.i.d.q.p.Coordinator:225 - Cost: 42593 ms, sql is select * from root.db.**
+```
+
diff --git a/src/zh/UserGuide/Master/Query-Data/Continuous-Query.md
b/src/zh/UserGuide/Master/Query-Data/Continuous-Query.md
index b6f229a..f925eae 100644
--- a/src/zh/UserGuide/Master/Query-Data/Continuous-Query.md
+++ b/src/zh/UserGuide/Master/Query-Data/Continuous-Query.md
@@ -24,6 +24,8 @@
### 简介
连续查询(Continuous queries, aka CQ) 是对实时数据周期性地自动执行的查询,并将查询结果写入指定的时间序列中。
+用户可以通过连续查询实现滑动窗口流式计算,如计算某个序列每小时平均温度,并写入一个新序列中。用户可以自定义 `RESAMPLE`
子句去创建不同的滑动窗口,可以实现对于乱序数据一定程度的容忍。
+
### 语法
```sql
diff --git a/src/zh/UserGuide/Master/Query-Data/Overview.md
b/src/zh/UserGuide/Master/Query-Data/Overview.md
index ebc6e81..6ce6120 100644
--- a/src/zh/UserGuide/Master/Query-Data/Overview.md
+++ b/src/zh/UserGuide/Master/Query-Data/Overview.md
@@ -55,7 +55,7 @@ SELECT [LAST] selectExpr [, selectExpr] ...
- `SELECT` 子句指定查询的输出,由若干个 `selectExpr` 组成。
- 每个 `selectExpr` 定义查询结果中的一列或多列,它是一个由时间序列路径后缀、常量、函数和运算符组成的表达式。
- 支持使用`AS`为查询结果集中的列指定别名。
-- 在 `SELECT` 子句中使用 `LAST` 关键词可以指定查询为最新点查询,详细说明及示例见文档 [最新点查询](./Last-Query.md) 。
+- 在 `SELECT` 子句中使用 `LAST` 关键词可以指定查询为最新点查询,详细说明及示例见文档
[最新点查询](../User-Manuel/Last-Query.md) 。
- 详细说明及示例见文档 [选择表达式](./Select-Expression.md) 。
#### `INTO` 子句
diff --git a/src/zh/UserGuide/Master/User-Manuel/Database-Programming.md
b/src/zh/UserGuide/Master/User-Manuel/Database-Programming.md
index 6fddb26..f7b9001 100644
--- a/src/zh/UserGuide/Master/User-Manuel/Database-Programming.md
+++ b/src/zh/UserGuide/Master/User-Manuel/Database-Programming.md
@@ -471,6 +471,8 @@ SHOW TRIGGERS
### 简介
连续查询(Continuous queries, aka CQ) 是对实时数据周期性地自动执行的查询,并将查询结果写入指定的时间序列中。
+用户可以通过连续查询实现滑动窗口流式计算,如计算某个序列每小时平均温度,并写入一个新序列中。用户可以自定义 `RESAMPLE`
子句去创建不同的滑动窗口,可以实现对于乱序数据一定程度的容忍。
+
### 语法
```sql
diff --git a/src/zh/UserGuide/Master/Query-Data/Last-Query.md
b/src/zh/UserGuide/Master/User-Manuel/Last-Query.md
similarity index 86%
rename from src/zh/UserGuide/Master/Query-Data/Last-Query.md
rename to src/zh/UserGuide/Master/User-Manuel/Last-Query.md
index 6390804..8167073 100644
--- a/src/zh/UserGuide/Master/Query-Data/Last-Query.md
+++ b/src/zh/UserGuide/Master/User-Manuel/Last-Query.md
@@ -25,7 +25,19 @@
在物联网数据分析场景中,此功能尤为重要。为了满足了用户对设备实时监控的需求,Apache IoTDB
对最新点查询进行了**缓存优化**,能够提供毫秒级的返回速度。
-SQL 语法:
+### 相关配置项
+IoTDB 在 `iotdb-common.properties` 中提供了 `enable_last_cache` 和
`schema_memory_proportion` 两个配置参数,分别用于开启/关闭最新点缓存,以及控制打开最新点缓存后的内存占用。
+
+#### enable_last_cache
+
+`enable_last_cache` 为 `true` 时,开启最新点缓存;为 `false` 时,关闭最新点缓存。
+
+#### schema_memory_proportion
+
+指定了 SchemaRegion, SchemaCache 以及 PartitionCache的内存分配比例,最新点缓存在 SchemaCache
中,所以可以通过调整这个参数,达到调整最新点缓存内存占用的效果。
+默认为 `5:4:1`,即最新点缓存所在的 SchemaCache,占用元数据内存的 40%。
+
+### SQL 语法:
```sql
select last <Path> [COMMA <Path>]* from < PrefixPath > [COMMA < PrefixPath >]*
<whereClause> [ORDER BY TIMESERIES (DESC | ASC)?]
diff --git a/src/zh/UserGuide/Master/User-Manuel/Query-Data.md
b/src/zh/UserGuide/Master/User-Manuel/Query-Data.md
index d2d22a0..3972b99 100644
--- a/src/zh/UserGuide/Master/User-Manuel/Query-Data.md
+++ b/src/zh/UserGuide/Master/User-Manuel/Query-Data.md
@@ -22,7 +22,7 @@
# 数据查询
## 概述
-在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据。
+在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据,IoTDB
不区分历史数据和实时数据,用户可以用统一的sql语法进行查询,通过 `WHERE` 子句中的时间过滤谓词决定查询的时间范围。
### 语法定义
@@ -120,6 +120,8 @@ SELECT [LAST] selectExpr [, selectExpr] ...
### SQL 示例
+IoTDB
支持即席(Ad_hoc)查询,即支持用户在使用系统时,自定义查询条件,根据自己当时的需求写出查询sql并执行。用户可以通过上述介绍的子句,进行组合,指定任意合法的过滤条件来满足当时的查询需求,下面介绍了一些查询的示例:
+
#### 示例1:根据一个时间区间选择一列数据
SQL 语句为:
diff --git a/src/zh/UserGuide/V1.1.x/Maintenance-Tools/Slow-Query-Management.md
b/src/zh/UserGuide/V1.1.x/Maintenance-Tools/Slow-Query-Management.md
new file mode 100644
index 0000000..f2348f2
--- /dev/null
+++ b/src/zh/UserGuide/V1.1.x/Maintenance-Tools/Slow-Query-Management.md
@@ -0,0 +1,35 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+# 慢查询管理
+
+IoTDB 会将慢查询输出到单独的日志文件 log_datanode_slow_sql.log 中,并记录其执行耗时。
+
+## 配置慢查询的阈值
+
+IoTDB 在 `iotdb-common.properties` 提供了 `slow_query_threshold`
配置项,单位是毫秒,默认是30秒,超过此参数指定的阈值,便会被判断为慢查询,待其查询执行结束后,将其记录在 log_datanode_slow_sql.log
中。
+
+## 慢查询日志示例
+
+```
+2023-07-31 20:15:00,533
[pool-27-IoTDB-ClientRPC-Processor-1$20230731_121500_00003_1] INFO
o.a.i.d.q.p.Coordinator:225 - Cost: 42593 ms, sql is select * from root.db.**
+```
+
diff --git a/src/zh/UserGuide/V1.1.x/Query-Data/Continuous-Query.md
b/src/zh/UserGuide/V1.1.x/Query-Data/Continuous-Query.md
index b6f229a..f925eae 100644
--- a/src/zh/UserGuide/V1.1.x/Query-Data/Continuous-Query.md
+++ b/src/zh/UserGuide/V1.1.x/Query-Data/Continuous-Query.md
@@ -24,6 +24,8 @@
### 简介
连续查询(Continuous queries, aka CQ) 是对实时数据周期性地自动执行的查询,并将查询结果写入指定的时间序列中。
+用户可以通过连续查询实现滑动窗口流式计算,如计算某个序列每小时平均温度,并写入一个新序列中。用户可以自定义 `RESAMPLE`
子句去创建不同的滑动窗口,可以实现对于乱序数据一定程度的容忍。
+
### 语法
```sql
diff --git a/src/zh/UserGuide/V1.1.x/Query-Data/Last-Query.md
b/src/zh/UserGuide/V1.1.x/Query-Data/Last-Query.md
index 86107e8..d320fe9 100644
--- a/src/zh/UserGuide/V1.1.x/Query-Data/Last-Query.md
+++ b/src/zh/UserGuide/V1.1.x/Query-Data/Last-Query.md
@@ -25,7 +25,19 @@
在物联网数据分析场景中,此功能尤为重要。为了满足了用户对设备实时监控的需求,Apache IoTDB
对最新点查询进行了**缓存优化**,能够提供毫秒级的返回速度。
-SQL 语法:
+### 相关配置项
+IoTDB 在 `iotdb-common.properties` 中提供了 `enable_last_cache` 和
`schema_memory_proportion` 两个配置参数,分别用于开启/关闭最新点缓存,以及控制打开最新点缓存后的内存占用。
+
+#### enable_last_cache
+
+`enable_last_cache` 为 `true` 时,开启最新点缓存;为 `false` 时,关闭最新点缓存。
+
+#### schema_memory_proportion
+
+指定了 SchemaRegion, SchemaCache 以及 PartitionCache的内存分配比例,最新点缓存在 SchemaCache
中,所以可以通过调整这个参数,达到调整最新点缓存内存占用的效果。
+默认为 `5:4:1`,即最新点缓存所在的 SchemaCache,占用元数据内存的 40%。
+
+### SQL 语法:
```sql
select last <Path> [COMMA <Path>]* from < PrefixPath > [COMMA < PrefixPath >]*
<whereClause> [ORDER BY TIMESERIES (DESC | ASC)?]
diff --git a/src/zh/UserGuide/V1.1.x/Query-Data/Overview.md
b/src/zh/UserGuide/V1.1.x/Query-Data/Overview.md
index 8b45276..7fe35df 100644
--- a/src/zh/UserGuide/V1.1.x/Query-Data/Overview.md
+++ b/src/zh/UserGuide/V1.1.x/Query-Data/Overview.md
@@ -22,7 +22,7 @@
# 数据查询
## 概述
-在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据。
+在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据,IoTDB
不区分历史数据和实时数据,用户可以用统一的sql语法进行查询,通过 `WHERE` 子句中的时间过滤谓词决定查询的时间范围。
### 语法定义
@@ -119,6 +119,8 @@ SELECT [LAST] selectExpr [, selectExpr] ...
### SQL 示例
+IoTDB
支持即席(Ad_hoc)查询,即支持用户在使用系统时,自定义查询条件,根据自己当时的需求写出查询sql并执行。用户可以通过上述介绍的子句,进行组合,指定任意合法的过滤条件来满足当时的查询需求,下面介绍了一些查询的示例:
+
#### 示例1:根据一个时间区间选择一列数据
SQL 语句为:
diff --git
a/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Slow-Query-Management.md
b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Slow-Query-Management.md
new file mode 100644
index 0000000..f2348f2
--- /dev/null
+++
b/src/zh/UserGuide/V1.2.x/Deployment-and-Maintenance/Slow-Query-Management.md
@@ -0,0 +1,35 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+# 慢查询管理
+
+IoTDB 会将慢查询输出到单独的日志文件 log_datanode_slow_sql.log 中,并记录其执行耗时。
+
+## 配置慢查询的阈值
+
+IoTDB 在 `iotdb-common.properties` 提供了 `slow_query_threshold`
配置项,单位是毫秒,默认是30秒,超过此参数指定的阈值,便会被判断为慢查询,待其查询执行结束后,将其记录在 log_datanode_slow_sql.log
中。
+
+## 慢查询日志示例
+
+```
+2023-07-31 20:15:00,533
[pool-27-IoTDB-ClientRPC-Processor-1$20230731_121500_00003_1] INFO
o.a.i.d.q.p.Coordinator:225 - Cost: 42593 ms, sql is select * from root.db.**
+```
+
diff --git a/src/zh/UserGuide/V1.2.x/Query-Data/Continuous-Query.md
b/src/zh/UserGuide/V1.2.x/Query-Data/Continuous-Query.md
index b6f229a..f925eae 100644
--- a/src/zh/UserGuide/V1.2.x/Query-Data/Continuous-Query.md
+++ b/src/zh/UserGuide/V1.2.x/Query-Data/Continuous-Query.md
@@ -24,6 +24,8 @@
### 简介
连续查询(Continuous queries, aka CQ) 是对实时数据周期性地自动执行的查询,并将查询结果写入指定的时间序列中。
+用户可以通过连续查询实现滑动窗口流式计算,如计算某个序列每小时平均温度,并写入一个新序列中。用户可以自定义 `RESAMPLE`
子句去创建不同的滑动窗口,可以实现对于乱序数据一定程度的容忍。
+
### 语法
```sql
diff --git a/src/zh/UserGuide/V1.2.x/Query-Data/Overview.md
b/src/zh/UserGuide/V1.2.x/Query-Data/Overview.md
index ebc6e81..88ef0f3 100644
--- a/src/zh/UserGuide/V1.2.x/Query-Data/Overview.md
+++ b/src/zh/UserGuide/V1.2.x/Query-Data/Overview.md
@@ -22,7 +22,7 @@
# 数据查询
## 概述
-在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据。
+在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据,IoTDB
不区分历史数据和实时数据,用户可以用统一的sql语法进行查询,通过 `WHERE` 子句中的时间过滤谓词决定查询的时间范围。
### 语法定义
@@ -55,7 +55,7 @@ SELECT [LAST] selectExpr [, selectExpr] ...
- `SELECT` 子句指定查询的输出,由若干个 `selectExpr` 组成。
- 每个 `selectExpr` 定义查询结果中的一列或多列,它是一个由时间序列路径后缀、常量、函数和运算符组成的表达式。
- 支持使用`AS`为查询结果集中的列指定别名。
-- 在 `SELECT` 子句中使用 `LAST` 关键词可以指定查询为最新点查询,详细说明及示例见文档 [最新点查询](./Last-Query.md) 。
+- 在 `SELECT` 子句中使用 `LAST` 关键词可以指定查询为最新点查询,详细说明及示例见文档
[最新点查询](../User-Manuel/Last-Query.md) 。
- 详细说明及示例见文档 [选择表达式](./Select-Expression.md) 。
#### `INTO` 子句
@@ -120,6 +120,8 @@ SELECT [LAST] selectExpr [, selectExpr] ...
### SQL 示例
+IoTDB
支持即席(Ad_hoc)查询,即支持用户在使用系统时,自定义查询条件,根据自己当时的需求写出查询sql并执行。用户可以通过上述介绍的子句,进行组合,指定任意合法的过滤条件来满足当时的查询需求,下面介绍了一些查询的示例:
+
#### 示例1:根据一个时间区间选择一列数据
SQL 语句为:
diff --git a/src/zh/UserGuide/V1.2.x/User-Manuel/Database-Programming.md
b/src/zh/UserGuide/V1.2.x/User-Manuel/Database-Programming.md
index 673ceea..0eca881 100644
--- a/src/zh/UserGuide/V1.2.x/User-Manuel/Database-Programming.md
+++ b/src/zh/UserGuide/V1.2.x/User-Manuel/Database-Programming.md
@@ -472,6 +472,8 @@ SHOW TRIGGERS
### 简介
连续查询(Continuous queries, aka CQ) 是对实时数据周期性地自动执行的查询,并将查询结果写入指定的时间序列中。
+用户可以通过连续查询实现滑动窗口流式计算,如计算某个序列每小时平均温度,并写入一个新序列中。用户可以自定义 `RESAMPLE`
子句去创建不同的滑动窗口,可以实现对于乱序数据一定程度的容忍。
+
### 语法
```sql
diff --git a/src/zh/UserGuide/V1.2.x/Query-Data/Last-Query.md
b/src/zh/UserGuide/V1.2.x/User-Manuel/Last-Query.md
similarity index 86%
rename from src/zh/UserGuide/V1.2.x/Query-Data/Last-Query.md
rename to src/zh/UserGuide/V1.2.x/User-Manuel/Last-Query.md
index 6390804..3599339 100644
--- a/src/zh/UserGuide/V1.2.x/Query-Data/Last-Query.md
+++ b/src/zh/UserGuide/V1.2.x/User-Manuel/Last-Query.md
@@ -25,7 +25,20 @@
在物联网数据分析场景中,此功能尤为重要。为了满足了用户对设备实时监控的需求,Apache IoTDB
对最新点查询进行了**缓存优化**,能够提供毫秒级的返回速度。
-SQL 语法:
+### 相关配置项
+IoTDB 在 `iotdb-common.properties` 中提供了 `enable_last_cache` 和
`schema_memory_proportion` 两个配置参数,分别用于开启/关闭最新点缓存,以及控制打开最新点缓存后的内存占用。
+
+#### enable_last_cache
+
+`enable_last_cache` 为 `true` 时,开启最新点缓存;为 `false` 时,关闭最新点缓存。
+
+#### schema_memory_proportion
+
+指定了 SchemaRegion, SchemaCache 以及 PartitionCache的内存分配比例,最新点缓存在 SchemaCache
中,所以可以通过调整这个参数,达到调整最新点缓存内存占用的效果。
+默认为 `5:4:1`,即最新点缓存所在的 SchemaCache,占用元数据内存的 40%。
+
+
+### SQL 语法:
```sql
select last <Path> [COMMA <Path>]* from < PrefixPath > [COMMA < PrefixPath >]*
<whereClause> [ORDER BY TIMESERIES (DESC | ASC)?]
diff --git a/src/zh/UserGuide/V1.2.x/User-Manuel/Query-Data.md
b/src/zh/UserGuide/V1.2.x/User-Manuel/Query-Data.md
index d2d22a0..3972b99 100644
--- a/src/zh/UserGuide/V1.2.x/User-Manuel/Query-Data.md
+++ b/src/zh/UserGuide/V1.2.x/User-Manuel/Query-Data.md
@@ -22,7 +22,7 @@
# 数据查询
## 概述
-在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据。
+在 IoTDB 中,使用 `SELECT` 语句从一条或多条时间序列中查询数据,IoTDB
不区分历史数据和实时数据,用户可以用统一的sql语法进行查询,通过 `WHERE` 子句中的时间过滤谓词决定查询的时间范围。
### 语法定义
@@ -120,6 +120,8 @@ SELECT [LAST] selectExpr [, selectExpr] ...
### SQL 示例
+IoTDB
支持即席(Ad_hoc)查询,即支持用户在使用系统时,自定义查询条件,根据自己当时的需求写出查询sql并执行。用户可以通过上述介绍的子句,进行组合,指定任意合法的过滤条件来满足当时的查询需求,下面介绍了一些查询的示例:
+
#### 示例1:根据一个时间区间选择一列数据
SQL 语句为: