Skip to content

Commit 90a62fe

Browse files
add workload group docs (#2257)
* add workload group docs * add workload group docs * add workload group docs --------- Co-authored-by: z <[email protected]>
1 parent 8092cad commit 90a62fe

File tree

7 files changed

+141
-0
lines changed

7 files changed

+141
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: ALTER WORKLOAD GROUP
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.743"/>
7+
8+
Update a workload group with specified quota settings.
9+
10+
## Syntax
11+
12+
```sql
13+
ALTER WORKLOAD GROUP <group_name>
14+
[SET cpu_quota = '<percentage>', query_timeout = '<duration>']
15+
```
16+
17+
## Parameters
18+
19+
| Parameter | Type | Required | Default | Description |
20+
|-----------------|----------|----------|--------------|-----------------------------------------------------------------------------|
21+
| `cpu_quota` | string | No | (unlimited) | CPU resource quota as percentage string (e.g. `"20%"`) |
22+
| `query_timeout` | duration | No | (unlimited) | Query timeout duration (units: `s`/`sec`=seconds, `m`/`min`=minutes, `h`/`hour`=hours, `d`/`day`=days, `ms`=milliseconds, unitless=seconds) |
23+
24+
25+
## Examples
26+
27+
```sql
28+
ALTER WORKLOAD GROUP analytics SET cpu_quota = '20%', query_timeout = '10m';
29+
```
30+
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
title: CREATE WORKLOAD GROUP
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.743"/>
7+
8+
Creates a workload group with specified quota settings.
9+
10+
## Syntax
11+
12+
```sql
13+
CREATE WORKLOAD GROUP [IF NOT EXISTS] <group_name>
14+
[WITH cpu_quota = '<percentage>', query_timeout = '<duration>']
15+
```
16+
17+
## Parameters
18+
19+
| Parameter | Type | Required | Default | Description |
20+
|-----------------|----------|----------|--------------|-----------------------------------------------------------------------------|
21+
| `cpu_quota` | string | No | (unlimited) | CPU resource quota as percentage string (e.g. `"20%"`) |
22+
| `query_timeout` | duration | No | (unlimited) | Query timeout duration (units: `s`/`sec`=seconds, `m`/`min`=minutes, `h`/`hour`=hours, `d`/`day`=days, `ms`=milliseconds, unitless=seconds) |
23+
24+
25+
## Examples
26+
27+
```sql
28+
CREATE WORKLOAD GROUP analytics WITH cpu_quota = '20%', query_timeout = '10m';
29+
```
30+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
title: DROP WORKLOAD GROUP
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.743"/>
7+
8+
Removes the specified workload group.
9+
10+
## Syntax
11+
12+
```sql
13+
DROP WORKLOAD GROUP [IF EXISTS] <workload_group_name>
14+
```
15+
16+
## Examples
17+
18+
This example removes the `test_workload_group` workload group:
19+
20+
```sql
21+
DROP WORKLOAD GROUP test_warehouse;
22+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
title: Workload Group
3+
---
4+
import IndexOverviewList from '@site/src/components/IndexOverviewList';
5+
6+
This page provides reference information for the workload-group-related commands in Databend.
7+
8+
<IndexOverviewList />
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: RENAME WORKLOAD GROUP
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.743"/>
7+
8+
Renames an existing workload group to a new name.
9+
10+
## Syntax
11+
12+
```sql
13+
RENAME WORKLOAD GROUP <current_name> TO <new_name>
14+
```
15+
16+
## Examples
17+
18+
This example renames `test_workload_group_1` to `test_workload_group`:
19+
20+
```sql
21+
RENAME WAREHOUSE test_workload_group_1 TO test_workload_group;
22+
```
23+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
title: SHOW WORKLOAD GROUPS
3+
---
4+
import FunctionDescription from '@site/src/components/FunctionDescription';
5+
6+
<FunctionDescription description="Introduced or updated: v1.2.743"/>
7+
8+
Returns a list of all existing workload groups along with their quotas.
9+
10+
## Syntax
11+
12+
```sql
13+
SHOW WORKLOAD GROUPS
14+
```
15+
16+
## Examples
17+
18+
```sql
19+
SHOW WORKLOAD GROUPS
20+
21+
┌────────────────────────────────────────────────────────────────────────────────────────────┐
22+
│ name │ cpu_quota │ memory_quota │ query_timeout │ max_concurrency │ query_queued_timeout │
23+
│ String │ String │ String │ String │ String │ String │
24+
├────────┼───────────┼──────────────┼───────────────┼─────────────────┼──────────────────────┤
25+
│ test │ 30% │ │ 15s │ │ │
26+
└────────────────────────────────────────────────────────────────────────────────────────────┘
27+
```

docs/en/sql-reference/10-sql-commands/00-ddl/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ These topics provide reference information for the DDL (Data Definition Language
5050
## Compute Resource Management
5151

5252
- [Warehouse](19-warehouse/index.md)
53+
- [Workload Group](20-workload-group/index.md)

0 commit comments

Comments
 (0)