Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
---

Check notice on line 1 in docs/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

View workflow job for this annotation

GitHub Actions / Build Check

i18n-sync-locale-candidate

Japanese docs are report-only. Generate a candidate translation from the changed files and merge it only after human review. Owner%3A @apache/doris-website-maintainers

Check notice on line 1 in docs/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

View workflow job for this annotation

GitHub Actions / Build Check

i18n-sync-version-candidate

A 3.x counterpart exists. Confirm whether the change is supported in 3.x before leaving it unsynced. Owner%3A @apache/doris-website-maintainers

Check warning on line 1 in docs/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "SHOW WORKLOAD GROUPS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @apache/doris-website-maintainers
{
"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

```sql
SHOW WORKLOAD GROUPS [LIKE "<pattern>"];
```

## 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
Expand Down Expand Up @@ -68,11 +68,15 @@
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
Expand All @@ -95,4 +99,43 @@
slot_memory_policy: none
running_query_num: 0
waiting_query_num: 0
```
```

## 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.
Original file line number Diff line number Diff line change
@@ -1,32 +1,29 @@
---

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "SHOW WORKLOAD GROUPS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @apache/doris-website-maintainers

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-description-length

SEO description should be 80-160 characters; current length is 33. Owner%3A @apache/doris-website-maintainers
{
"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 "<pattern>"];
```

## 注意事项
## 示例

该语句仅做资源组简单展示,更复杂的展示可参考 tvf workload_groups().
### 示例 1:展示所有资源组

## 示例
```sql
SHOW WORKLOAD GROUPS;
```

1. 展示所有资源组:

```sql
```text
mysql> show workload groups \G;
*************************** 1. row ***************************
Id: 1754728930516
Expand Down Expand Up @@ -70,12 +67,15 @@
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
Expand All @@ -98,4 +98,43 @@
slot_memory_policy: none
running_query_num: 0
waiting_query_num: 0
```
```

## 字段说明

返回当前用户可见的 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` 出于兼容性通常无需额外授权也可见。
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
---

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-title-duplicate

Rendered SEO title is duplicated across indexable pages%3A "SHOW WORKLOAD GROUPS - Apache Doris". Add a version%2C locale%2C or page-specific qualifier. Owner%3A @apache/doris-sql-reviewers

Check warning on line 1 in i18n/zh-CN/docusaurus-plugin-content-docs/version-4.x/sql-manual/sql-statements/cluster-management/compute-management/SHOW-WORKLOAD-GROUPS.md

View workflow job for this annotation

GitHub Actions / Build Check

seo-description-length

SEO description should be 80-160 characters; current length is 33. Owner%3A @apache/doris-sql-reviewers
{
"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 "<pattern>"];
```

## 注意事项
## 示例

该语句仅做资源组简单展示,更复杂的展示可参考 tvf workload_groups().
### 示例 1:展示所有资源组

## 示例
```sql
SHOW WORKLOAD GROUPS;
```

1. 展示所有资源组:

```sql
```text
mysql> show workload groups \G;
*************************** 1. row ***************************
Id: 1754728930516
Expand Down Expand Up @@ -70,12 +68,15 @@
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
Expand All @@ -98,4 +99,43 @@
slot_memory_policy: none
running_query_num: 0
waiting_query_num: 0
```
```

## 字段说明

返回当前用户可见的 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` 出于兼容性通常无需额外授权也可见。
Loading
Loading