Skip to content

Commit 5d9bcf9

Browse files
evenyagfengjiachun
andauthored
docs: add document for max_execution_time and statement_timeout (#1937)
Signed-off-by: evenyag <[email protected]> Co-authored-by: jeremyhi <[email protected]>
1 parent 0f5ae80 commit 5d9bcf9

File tree

8 files changed

+80
-0
lines changed

8 files changed

+80
-0
lines changed

docs/user-guide/protocols/mysql.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,13 @@ SELECT @@system_time_zone, @@time_zone;
8080
```
8181

8282
For information on how the time zone affects data inserts and queries, please refer to the SQL documents in the [Ingest Data](/user-guide/ingest-data/for-iot/sql.md#time-zone) and [Query Data](/user-guide/query-data/sql.md#time-zone) sections.
83+
84+
## Query Timeout
85+
86+
You can set the `max_execution_time` variable for the current session using SQL statement `SET max_execution_time = <value>` or `SET MAX_EXECUTION_TIME = <value>`, which specifies the maximum time in milliseconds for a **read-only statement** to execute. The server will terminate the query if it exceeds the specified time.
87+
88+
For example, to set the maximum query execution time to 10 seconds:
89+
90+
```SQL
91+
SET max_execution_time=10000;
92+
```

docs/user-guide/protocols/postgresql.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,13 @@ SELECT
176176
count(latency)
177177
FROM ft_grpc_latencies GROUP BY host, t;
178178
```
179+
180+
## Statement Timeout
181+
182+
You can set the `statement_timeout` variable for the current session using SQL statement `SET statement_timeout = <value>` or `SET STATEMENT_TIMEOUT = <value>`, which specifies the maximum time in milliseconds for a statement to execute. The server will terminate the statement if it exceeds the specified time.
183+
184+
For example, to set the maximum execution time to 10 seconds:
185+
186+
```SQL
187+
SET statement_timeout=10000;
188+
```

i18n/zh/docusaurus-plugin-content-docs/current/user-guide/protocols/mysql.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,13 @@ SELECT @@system_time_zone, @@time_zone;
7676
```
7777

7878
有关时区如何影响数据的插入和查询,请参考 [写入数据](/user-guide/ingest-data/for-iot/sql.md#时区)[查询数据](/user-guide/query-data/sql.md#时区) 中的 SQL 文档。
79+
80+
## 查询超时
81+
82+
可以通过 SQL 语句 `SET max_execution_time = <value>``SET MAX_EXECUTION_TIME = <value>` 为当前会话设置 `max_execution_time` 变量,该变量指定**只读语句**执行的最大时间(以毫秒为单位)。如果查询的执行时间超过指定时间,服务器将终止该查询。
83+
84+
例如,将最大执行时间设置为 10 秒:
85+
86+
```SQL
87+
SET max_execution_time=10000;
88+
```

i18n/zh/docusaurus-plugin-content-docs/current/user-guide/protocols/postgresql.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,13 @@ SELECT
171171
count(latency)
172172
FROM ft_grpc_latencies GROUP BY host, t;
173173
```
174+
175+
## 语句执行超时
176+
177+
你可以通过 SQL 语句 `SET statement_timeout = <value>``SET STATEMENT_TIMEOUT = <value>` 为当前会话设置 `statement_timeout` 变量,该变量指定语句执行的最大时间(以毫秒为单位)。如果语句的执行时间超过指定时间,服务器将终止该语句。
178+
179+
例如,将最大执行时间设置为 10 秒:
180+
181+
```SQL
182+
SET statement_timeout=10000;
183+
```

i18n/zh/docusaurus-plugin-content-docs/version-0.15/user-guide/protocols/mysql.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,13 @@ SELECT @@system_time_zone, @@time_zone;
7676
```
7777

7878
有关时区如何影响数据的插入和查询,请参考 [写入数据](/user-guide/ingest-data/for-iot/sql.md#时区)[查询数据](/user-guide/query-data/sql.md#时区) 中的 SQL 文档。
79+
80+
## 查询超时
81+
82+
可以通过 SQL 语句 `SET max_execution_time = <value>``SET MAX_EXECUTION_TIME = <value>` 为当前会话设置 `max_execution_time` 变量,该变量指定**只读语句**执行的最大时间(以毫秒为单位)。如果查询的执行时间超过指定时间,服务器将终止该查询。
83+
84+
例如,将最大执行时间设置为 10 秒:
85+
86+
```SQL
87+
SET max_execution_time=10000;
88+
```

i18n/zh/docusaurus-plugin-content-docs/version-0.15/user-guide/protocols/postgresql.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,13 @@ SELECT
171171
count(latency)
172172
FROM ft_grpc_latencies GROUP BY host, t;
173173
```
174+
175+
## 语句执行超时
176+
177+
你可以通过 SQL 语句 `SET statement_timeout = <value>``SET STATEMENT_TIMEOUT = <value>` 为当前会话设置 `statement_timeout` 变量,该变量指定语句执行的最大时间(以毫秒为单位)。如果语句的执行时间超过指定时间,服务器将终止该语句。
178+
179+
例如,将最大执行时间设置为 10 秒:
180+
181+
```SQL
182+
SET statement_timeout=10000;
183+
```

versioned_docs/version-0.15/user-guide/protocols/mysql.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,13 @@ SELECT @@system_time_zone, @@time_zone;
8080
```
8181

8282
For information on how the time zone affects data inserts and queries, please refer to the SQL documents in the [Ingest Data](/user-guide/ingest-data/for-iot/sql.md#time-zone) and [Query Data](/user-guide/query-data/sql.md#time-zone) sections.
83+
84+
## Query Timeout
85+
86+
You can set the `max_execution_time` variable for the current session using SQL statement `SET max_execution_time = <value>` or `SET MAX_EXECUTION_TIME = <value>`, which specifies the maximum time in milliseconds for a **read-only statement** to execute. The server will terminate the query if it exceeds the specified time.
87+
88+
For example, to set the maximum query execution time to 10 seconds:
89+
90+
```SQL
91+
SET max_execution_time=10000;
92+
```

versioned_docs/version-0.15/user-guide/protocols/postgresql.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,13 @@ SELECT
176176
count(latency)
177177
FROM ft_grpc_latencies GROUP BY host, t;
178178
```
179+
180+
## Statement Timeout
181+
182+
You can set the `statement_timeout` variable for the current session using SQL statement `SET statement_timeout = <value>` or `SET STATEMENT_TIMEOUT = <value>`, which specifies the maximum time in milliseconds for a statement to execute. The server will terminate the statement if it exceeds the specified time.
183+
184+
For example, to set the maximum execution time to 10 seconds:
185+
186+
```SQL
187+
SET statement_timeout=10000;
188+
```

0 commit comments

Comments
 (0)