diff --git a/docs/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md b/docs/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md index 669bc7bd976a7..fea4837c88491 100644 --- a/docs/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md +++ b/docs/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md @@ -2,13 +2,13 @@ { "title": "SHOW WORKLOAD GROUPS", "language": "en", - "description": "This statement is used to display the resource groups for which the current user has usagepriv privileges." + "description": "This statement displays the workload groups that the current user is allowed to view." } --- ## Description -This statement is used to display the resource groups for which the current user has usage_priv privileges. +This statement displays the workload groups that the current user is allowed to view. You can use `LIKE` for name-based pattern matching. To view a specific workload group, the user must have `USAGE_PRIV` on that workload group or have the global `ADMIN_PRIV`. ## Syntax @@ -16,15 +16,15 @@ This statement is used to display the resource groups for which the current user SHOW WORKLOAD GROUPS [LIKE ""]; ``` -## Usage Notes +## Examples -This statement only does a simple display of workload groups, for a more complex display refer to tvf workload_groups(). +### Example 1: Show all workload groups -## Examples +```sql +SHOW WORKLOAD GROUPS; +``` -1. Show all workload groups: - - ```sql +```text mysql> show workload groups \G; *************************** 1. row *************************** Id: 1754728930516 @@ -68,11 +68,15 @@ remote_read_bytes_per_second: -1 slot_memory_policy: none running_query_num: 0 waiting_query_num: 0 - ``` +``` + +### Example 2: Show workload groups using a pattern + +```sql +SHOW WORKLOAD GROUPS LIKE "normal%"; +``` -2. Show workload groups using pattern - - ```sql +```text mysql> show workload groups like "normal%" \G; *************************** 1. row *************************** Id: 1754728930516 @@ -95,4 +99,43 @@ remote_read_bytes_per_second: -1 slot_memory_policy: none running_query_num: 0 waiting_query_num: 0 - ``` \ No newline at end of file +``` + +## Field Descriptions + +This statement returns the workload groups visible to the current user. Common output fields are described below: + +| Field | Description | +| --- | --- | +| `Id` | The ID of the workload group. | +| `Name` | The workload group name. | +| `min_cpu_percent` | The minimum guaranteed CPU percentage. | +| `max_cpu_percent` | The maximum CPU percentage. | +| `min_memory_percent` | The minimum guaranteed memory percentage. | +| `max_memory_percent` | The maximum memory percentage. | +| `max_concurrency` | The maximum number of concurrent queries. | +| `max_queue_size` | The maximum queue length for waiting queries. | +| `queue_timeout` | The maximum queue wait time in milliseconds. | +| `scan_thread_num` | The number of local scan threads used by the workload group. | +| `max_remote_scan_thread_num` | The maximum number of scan threads for remote data sources. | +| `min_remote_scan_thread_num` | The minimum number of scan threads for remote data sources. | +| `memory_low_watermark` | The low memory watermark. | +| `memory_high_watermark` | The high memory watermark. | +| `compute_group` | The compute group to which the workload group belongs. In non-cloud mode, this usually shows the default resource group/tag, such as `default`. | +| `read_bytes_per_second` | The IO throughput limit for reading Doris internal tables, in bytes per second. `-1` means unlimited. | +| `remote_read_bytes_per_second` | The IO throughput limit for reading remote data sources, in bytes per second. `-1` means unlimited. | +| `slot_memory_policy` | The memory allocation policy for query slots. | +| `running_query_num` | The number of queries currently running in this workload group. | +| `waiting_query_num` | The number of queries currently waiting in this workload group's queue. | + +## Usage Notes + +1. This statement supports only `LIKE` filtering and does not support a `WHERE` clause. +2. This statement is intended for simple display of workload group information. For more complex querying or filtering, use the TVF `workload_groups()`. +3. Results are filtered by privilege. To view a specific workload group, the user must have `USAGE_PRIV` on that workload group or have the global `ADMIN_PRIV`. Example: + + ```sql + GRANT USAGE_PRIV ON WORKLOAD GROUP 'g1' TO 'user_1'@'%'; + ``` + +4. In the current implementation, the default workload group `normal` is usually visible without extra authorization for compatibility reasons. diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md index 928ceae9b6c3a..60b8729c867b3 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md @@ -2,31 +2,28 @@ { "title": "SHOW WORKLOAD GROUPS", "language": "zh-CN", - "description": "该语句用于展示当前用户具有 usagepriv 权限的资源组。" + "description": "该语句用于展示当前用户有权限查看的 Workload Group。" } --- ## 描述 - -该语句用于展示当前用户具有 usage_priv 权限的资源组。 - - +该语句用于展示当前用户有权限查看的 Workload Group。支持使用 `LIKE` 按名称进行模糊匹配。要查看某个 Workload Group,用户需要拥有该 Workload Group 上的 `USAGE_PRIV`,或者拥有全局 `ADMIN_PRIV`。 ## 语法 ```sql SHOW WORKLOAD GROUPS [LIKE ""]; ``` -## 注意事项 +## 示例 -该语句仅做资源组简单展示,更复杂的展示可参考 tvf workload_groups(). +### 示例 1:展示所有资源组 -## 示例 +```sql +SHOW WORKLOAD GROUPS; +``` -1. 展示所有资源组: - - ```sql +```text mysql> show workload groups \G; *************************** 1. row *************************** Id: 1754728930516 @@ -70,12 +67,15 @@ remote_read_bytes_per_second: -1 slot_memory_policy: none running_query_num: 0 waiting_query_num: 0 - ``` +``` -2. 使用 LIKE 模糊匹配: - +### 示例 2:使用 LIKE 模糊匹配 - ```sql +```sql +SHOW WORKLOAD GROUPS LIKE "normal%"; +``` + +```text mysql> show workload groups like "normal%" \G; *************************** 1. row *************************** Id: 1754728930516 @@ -98,4 +98,43 @@ remote_read_bytes_per_second: -1 slot_memory_policy: none running_query_num: 0 waiting_query_num: 0 - ``` \ No newline at end of file +``` + +## 字段说明 + +返回当前用户可见的 Workload Group 列表。常见返回字段说明如下: + +| 字段 | 说明 | +| --- | --- | +| `Id` | Workload Group 的 ID。 | +| `Name` | Workload Group 名称。 | +| `min_cpu_percent` | CPU 最低保障比例。 | +| `max_cpu_percent` | CPU 使用上限比例。 | +| `min_memory_percent` | 内存最低保障比例。 | +| `max_memory_percent` | 内存使用上限比例。 | +| `max_concurrency` | 最大并发查询数。 | +| `max_queue_size` | 查询排队队列长度上限。 | +| `queue_timeout` | 查询在队列中的最大等待时间,单位为毫秒。 | +| `scan_thread_num` | 当前 Workload Group 使用的本地扫描线程数。 | +| `max_remote_scan_thread_num` | 读取远程数据源时允许使用的最大扫描线程数。 | +| `min_remote_scan_thread_num` | 读取远程数据源时允许使用的最小扫描线程数。 | +| `memory_low_watermark` | 内存低水位阈值。 | +| `memory_high_watermark` | 内存高水位阈值。 | +| `compute_group` | Workload Group 所属的 compute group。存算一体模式下通常显示默认 resource group/tag,例如 `default`。 | +| `read_bytes_per_second` | 读取 Doris 内表时的 IO 吞吐限制,单位为字节每秒;`-1` 表示不限制。 | +| `remote_read_bytes_per_second` | 读取远程数据源时的 IO 吞吐限制,单位为字节每秒;`-1` 表示不限制。 | +| `slot_memory_policy` | Query slot 的内存分配策略。 | +| `running_query_num` | 当前正在该 Workload Group 中运行的查询数。 | +| `waiting_query_num` | 当前在该 Workload Group 队列中等待的查询数。 | + +## 注意事项 + +1. 该语句仅支持 `LIKE` 过滤,不支持 `WHERE` 子句。 +2. 该语句用于简单展示 Workload Group 信息;如需更复杂的查询或筛选,可参考 TVF `workload_groups()`。 +3. 返回结果会按当前用户权限过滤;要查看某个 Workload Group,用户需要拥有该 Workload Group 上的 `USAGE_PRIV`,或者拥有全局 `ADMIN_PRIV`。授权示例: + + ```sql + GRANT USAGE_PRIV ON WORKLOAD GROUP 'g1' TO 'user_1'@'%'; + ``` + +4. 当前实现中,默认 Workload Group `normal` 出于兼容性通常无需额外授权也可见。 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md index 928ceae9b6c3a..b1a4d906e712a 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md @@ -2,15 +2,13 @@ { "title": "SHOW WORKLOAD GROUPS", "language": "zh-CN", - "description": "该语句用于展示当前用户具有 usagepriv 权限的资源组。" + "description": "该语句用于展示当前用户有权限查看的 Workload Group。" } --- ## 描述 - -该语句用于展示当前用户具有 usage_priv 权限的资源组。 - +该语句用于展示当前用户有权限查看的 Workload Group。支持使用 `LIKE` 按名称进行模糊匹配。要查看某个 Workload Group,用户需要拥有该 Workload Group 上的 `USAGE_PRIV`,或者拥有全局 `ADMIN_PRIV`。 ## 语法 @@ -18,15 +16,15 @@ SHOW WORKLOAD GROUPS [LIKE ""]; ``` -## 注意事项 +## 示例 -该语句仅做资源组简单展示,更复杂的展示可参考 tvf workload_groups(). +### 示例 1:展示所有资源组 -## 示例 +```sql +SHOW WORKLOAD GROUPS; +``` -1. 展示所有资源组: - - ```sql +```text mysql> show workload groups \G; *************************** 1. row *************************** Id: 1754728930516 @@ -70,12 +68,15 @@ remote_read_bytes_per_second: -1 slot_memory_policy: none running_query_num: 0 waiting_query_num: 0 - ``` +``` -2. 使用 LIKE 模糊匹配: - +### 示例 2:使用 LIKE 模糊匹配 + +```sql +SHOW WORKLOAD GROUPS LIKE "normal%"; +``` - ```sql +```text mysql> show workload groups like "normal%" \G; *************************** 1. row *************************** Id: 1754728930516 @@ -98,4 +99,43 @@ remote_read_bytes_per_second: -1 slot_memory_policy: none running_query_num: 0 waiting_query_num: 0 - ``` \ No newline at end of file +``` + +## 字段说明 + +返回当前用户可见的 Workload Group 列表。常见返回字段说明如下: + +| 字段 | 说明 | +| --- | --- | +| `Id` | Workload Group 的 ID。 | +| `Name` | Workload Group 名称。 | +| `min_cpu_percent` | CPU 最低保障比例。 | +| `max_cpu_percent` | CPU 使用上限比例。 | +| `min_memory_percent` | 内存最低保障比例。 | +| `max_memory_percent` | 内存使用上限比例。 | +| `max_concurrency` | 最大并发查询数。 | +| `max_queue_size` | 查询排队队列长度上限。 | +| `queue_timeout` | 查询在队列中的最大等待时间,单位为毫秒。 | +| `scan_thread_num` | 当前 Workload Group 使用的本地扫描线程数。 | +| `max_remote_scan_thread_num` | 读取远程数据源时允许使用的最大扫描线程数。 | +| `min_remote_scan_thread_num` | 读取远程数据源时允许使用的最小扫描线程数。 | +| `memory_low_watermark` | 内存低水位阈值。 | +| `memory_high_watermark` | 内存高水位阈值。 | +| `compute_group` | Workload Group 所属的 compute group。存算一体模式下通常显示默认 resource group/tag,例如 `default`。 | +| `read_bytes_per_second` | 读取 Doris 内表时的 IO 吞吐限制,单位为字节每秒;`-1` 表示不限制。 | +| `remote_read_bytes_per_second` | 读取远程数据源时的 IO 吞吐限制,单位为字节每秒;`-1` 表示不限制。 | +| `slot_memory_policy` | Query slot 的内存分配策略。 | +| `running_query_num` | 当前正在该 Workload Group 中运行的查询数。 | +| `waiting_query_num` | 当前在该 Workload Group 队列中等待的查询数。 | + +## 注意事项 + +1. 该语句仅支持 `LIKE` 过滤,不支持 `WHERE` 子句。 +2. 该语句用于简单展示 Workload Group 信息;如需更复杂的查询或筛选,可参考 TVF `workload_groups()`。 +3. 返回结果会按当前用户权限过滤;要查看某个 Workload Group,用户需要拥有该 Workload Group 上的 `USAGE_PRIV`,或者拥有全局 `ADMIN_PRIV`。授权示例: + + ```sql + GRANT USAGE_PRIV ON WORKLOAD GROUP 'g1' TO 'user_1'@'%'; + ``` + +4. 当前实现中,默认 Workload Group `normal` 出于兼容性通常无需额外授权也可见。 diff --git a/versioned_docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md b/versioned_docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md index 669bc7bd976a7..fea4837c88491 100644 --- a/versioned_docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md +++ b/versioned_docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md @@ -2,13 +2,13 @@ { "title": "SHOW WORKLOAD GROUPS", "language": "en", - "description": "This statement is used to display the resource groups for which the current user has usagepriv privileges." + "description": "This statement displays the workload groups that the current user is allowed to view." } --- ## Description -This statement is used to display the resource groups for which the current user has usage_priv privileges. +This statement displays the workload groups that the current user is allowed to view. You can use `LIKE` for name-based pattern matching. To view a specific workload group, the user must have `USAGE_PRIV` on that workload group or have the global `ADMIN_PRIV`. ## Syntax @@ -16,15 +16,15 @@ This statement is used to display the resource groups for which the current user SHOW WORKLOAD GROUPS [LIKE ""]; ``` -## Usage Notes +## Examples -This statement only does a simple display of workload groups, for a more complex display refer to tvf workload_groups(). +### Example 1: Show all workload groups -## Examples +```sql +SHOW WORKLOAD GROUPS; +``` -1. Show all workload groups: - - ```sql +```text mysql> show workload groups \G; *************************** 1. row *************************** Id: 1754728930516 @@ -68,11 +68,15 @@ remote_read_bytes_per_second: -1 slot_memory_policy: none running_query_num: 0 waiting_query_num: 0 - ``` +``` + +### Example 2: Show workload groups using a pattern + +```sql +SHOW WORKLOAD GROUPS LIKE "normal%"; +``` -2. Show workload groups using pattern - - ```sql +```text mysql> show workload groups like "normal%" \G; *************************** 1. row *************************** Id: 1754728930516 @@ -95,4 +99,43 @@ remote_read_bytes_per_second: -1 slot_memory_policy: none running_query_num: 0 waiting_query_num: 0 - ``` \ No newline at end of file +``` + +## Field Descriptions + +This statement returns the workload groups visible to the current user. Common output fields are described below: + +| Field | Description | +| --- | --- | +| `Id` | The ID of the workload group. | +| `Name` | The workload group name. | +| `min_cpu_percent` | The minimum guaranteed CPU percentage. | +| `max_cpu_percent` | The maximum CPU percentage. | +| `min_memory_percent` | The minimum guaranteed memory percentage. | +| `max_memory_percent` | The maximum memory percentage. | +| `max_concurrency` | The maximum number of concurrent queries. | +| `max_queue_size` | The maximum queue length for waiting queries. | +| `queue_timeout` | The maximum queue wait time in milliseconds. | +| `scan_thread_num` | The number of local scan threads used by the workload group. | +| `max_remote_scan_thread_num` | The maximum number of scan threads for remote data sources. | +| `min_remote_scan_thread_num` | The minimum number of scan threads for remote data sources. | +| `memory_low_watermark` | The low memory watermark. | +| `memory_high_watermark` | The high memory watermark. | +| `compute_group` | The compute group to which the workload group belongs. In non-cloud mode, this usually shows the default resource group/tag, such as `default`. | +| `read_bytes_per_second` | The IO throughput limit for reading Doris internal tables, in bytes per second. `-1` means unlimited. | +| `remote_read_bytes_per_second` | The IO throughput limit for reading remote data sources, in bytes per second. `-1` means unlimited. | +| `slot_memory_policy` | The memory allocation policy for query slots. | +| `running_query_num` | The number of queries currently running in this workload group. | +| `waiting_query_num` | The number of queries currently waiting in this workload group's queue. | + +## Usage Notes + +1. This statement supports only `LIKE` filtering and does not support a `WHERE` clause. +2. This statement is intended for simple display of workload group information. For more complex querying or filtering, use the TVF `workload_groups()`. +3. Results are filtered by privilege. To view a specific workload group, the user must have `USAGE_PRIV` on that workload group or have the global `ADMIN_PRIV`. Example: + + ```sql + GRANT USAGE_PRIV ON WORKLOAD GROUP 'g1' TO 'user_1'@'%'; + ``` + +4. In the current implementation, the default workload group `normal` is usually visible without extra authorization for compatibility reasons.