Skip to content

Commit b52407b

Browse files
authored
docs: update warehouse ops (#3060)
1 parent 8f57a4f commit b52407b

File tree

9 files changed

+87
-130
lines changed

9 files changed

+87
-130
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Dependencies
22
/node_modules
3+
/worktrees
34

45
# Production
56
/build

docs/en/sql-reference/10-sql-commands/00-ddl/19-warehouse/alter-warehouse.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ ALTER WAREHOUSE <warehouse_name> { SUSPEND | RESUME }
1717

1818
-- Modify warehouse settings
1919
ALTER WAREHOUSE <warehouse_name>
20-
SET [ WITH ] warehouse_size = <size>
21-
[ WITH ] auto_suspend = <nullable_unsigned_number>
22-
[ WITH ] auto_resume = <bool>
23-
[ WITH ] max_cluster_count = <nullable_unsigned_number>
24-
[ WITH ] min_cluster_count = <nullable_unsigned_number>
25-
[ WITH ] comment = '<string_literal>'
20+
SET [ warehouse_size = <size> ]
21+
[ auto_suspend = <nullable_unsigned_number> ]
22+
[ auto_resume = <bool> ]
23+
[ max_cluster_count = <nullable_unsigned_number> ]
24+
[ min_cluster_count = <nullable_unsigned_number> ]
25+
[ comment = '<string_literal>' ]
2626

2727
ALTER WAREHOUSE <warehouse_name> SET TAG <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' ... ]
2828

@@ -31,24 +31,24 @@ ALTER WAREHOUSE <warehouse_name> UNSET TAG <tag_name> [ , <tag_name> ... ]
3131
ALTER WAREHOUSE <warehouse_name> RENAME TO <new_name>
3232
```
3333

34-
| Parameter | Description |
35-
|-----------|-------------|
36-
| `SUSPEND` | Immediately suspends the warehouse. |
37-
| `RESUME` | Immediately resumes the warehouse. |
38-
| `SET` | Modifies one or more warehouse options. Unspecified fields remain unchanged. |
34+
| Parameter | Description |
35+
| --------- | ---------------------------------------------------------------------------- |
36+
| `SUSPEND` | Immediately suspends the warehouse. |
37+
| `RESUME` | Immediately resumes the warehouse. |
38+
| `SET` | Modifies one or more warehouse options. Unspecified fields remain unchanged. |
3939

4040
## Options
4141

4242
The `SET` clause accepts the same options as [CREATE WAREHOUSE](create-warehouse.md):
4343

44-
| Option | Type / Values | Description |
45-
|--------|---------------|-------------|
46-
| `WAREHOUSE_SIZE` | `XSmall`, `Small`, `Medium`, `Large`, `XLarge`, `2XLarge``6XLarge` | Changes compute size. |
47-
| `AUTO_SUSPEND` | `NULL`, `0`, or ≥300 seconds | Idle timeout before automatic suspend. `NULL` disables auto-suspend. |
48-
| `AUTO_RESUME` | Boolean | Controls whether incoming queries wake the warehouse automatically. |
49-
| `MAX_CLUSTER_COUNT` | `NULL` or non-negative integer | Upper bound for auto-scaling clusters. |
50-
| `MIN_CLUSTER_COUNT` | `NULL` or non-negative integer | Lower bound for auto-scaling clusters. |
51-
| `COMMENT` | String | Free-form text description. |
44+
| Option | Type / Values | Description |
45+
| ------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------- |
46+
| `WAREHOUSE_SIZE` | `XSmall`, `Small`, `Medium`, `Large`, `XLarge`, `2XLarge``6XLarge` | Changes compute size. |
47+
| `AUTO_SUSPEND` | `NULL`, `0`, or ≥300 seconds | Idle timeout before automatic suspend. `NULL` disables auto-suspend. |
48+
| `AUTO_RESUME` | Boolean | Controls whether incoming queries wake the warehouse automatically. |
49+
| `MAX_CLUSTER_COUNT` | `NULL` or non-negative integer | Upper bound for auto-scaling clusters. |
50+
| `MIN_CLUSTER_COUNT` | `NULL` or non-negative integer | Lower bound for auto-scaling clusters. |
51+
| `COMMENT` | String | Free-form text description. |
5252

5353
- `NULL` is valid for numeric options to reset them to `0`.
5454
- Supplying `SET` with no options raises an error.

docs/en/sql-reference/10-sql-commands/00-ddl/19-warehouse/create-warehouse.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@ CREATE WAREHOUSE [ IF NOT EXISTS ] <warehouse_name>
2323
[ WITH ] TAG ( <tag_name> = '<tag_value>' [ , <tag_name> = '<tag_value>' , ... ] )
2424
```
2525

26-
| Parameter | Description |
27-
|-----------|-------------|
26+
| Parameter | Description |
27+
| --------------- | --------------------------------------------------------------------------------------------- |
2828
| `IF NOT EXISTS` | Optional. If specified, the command succeeds without changes if the warehouse already exists. |
29-
| warehouse_name | 3–63 characters, containing only `A-Z`, `a-z`, `0-9`, and `-`. |
29+
| warehouse_name | 3–63 characters, containing only `A-Z`, `a-z`, `0-9`, and `-`. |
3030

3131
## Options
3232

33-
| Option | Type / Values | Default | Description |
34-
|--------|---------------|---------|-------------|
35-
| `WAREHOUSE_SIZE` | `XSmall`, `Small`, `Medium`, `Large`, `XLarge`, `2XLarge``6XLarge` (case-insensitive) | `Small` | Controls compute size. |
36-
| `AUTO_SUSPEND` | `NULL`, `0`, or ≥300 seconds | `600` seconds | Idle timeout before automatic suspend. `0`/`NULL` means never suspend; values below 300 are rejected. |
37-
| `INITIALLY_SUSPENDED` | Boolean | `FALSE` | If `TRUE`, the warehouse remains suspended after creation until explicitly resumed. |
38-
| `AUTO_RESUME` | Boolean | `TRUE` | Controls whether incoming queries wake the warehouse automatically. |
39-
| `MAX_CLUSTER_COUNT` | `NULL` or non-negative integer | `0` | Upper bound for auto-scaling clusters. `0` disables auto-scale. |
40-
| `MIN_CLUSTER_COUNT` | `NULL` or non-negative integer | `0` | Lower bound for auto-scaling clusters; should be ≤ `MAX_CLUSTER_COUNT`. |
41-
| `COMMENT` | String | Empty | Free-form text surfaced by `SHOW WAREHOUSES`. |
42-
| `TAG` | Key-value pairs: `TAG ( key1 = 'value1', key2 = 'value2' )` | None | Resource tags for categorization and organization (similar to AWS tags). Used for cost allocation, environment identification, or team ownership. |
33+
| Option | Type / Values | Default | Description |
34+
| --------------------- | -------------------------------------------------------------------------------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
35+
| `WAREHOUSE_SIZE` | `XSmall`, `Small`, `Medium`, `Large`, `XLarge`, `2XLarge``6XLarge` (case-insensitive) | `Small` | Controls compute size. |
36+
| `AUTO_SUSPEND` | `NULL`, `0`, or ≥300 seconds | `600` seconds | Idle timeout before automatic suspend. `0`/`NULL` means never suspend; values below 300 are rejected. |
37+
| `INITIALLY_SUSPENDED` | Boolean | `FALSE` | If `TRUE`, the warehouse remains suspended after creation until explicitly resumed. |
38+
| `AUTO_RESUME` | Boolean | `TRUE` | Controls whether incoming queries wake the warehouse automatically. |
39+
| `MAX_CLUSTER_COUNT` | `NULL` or non-negative integer | `0` | Upper bound for auto-scaling clusters. `0` disables auto-scale. |
40+
| `MIN_CLUSTER_COUNT` | `NULL` or non-negative integer | `0` | Lower bound for auto-scaling clusters; should be ≤ `MAX_CLUSTER_COUNT`. |
41+
| `COMMENT` | String | Empty | Free-form text surfaced by `SHOW WAREHOUSES`. |
42+
| `TAG` | Key-value pairs: `TAG ( key1 = 'value1', key2 = 'value2' )` | None | Resource tags for categorization and organization (similar to AWS tags). Used for cost allocation, environment identification, or team ownership. |
4343

4444
- Options may appear in any order and may repeat (the later value wins).
4545
- `AUTO_SUSPEND`, `MAX_CLUSTER_COUNT`, and `MIN_CLUSTER_COUNT` accept `= NULL` to reset to `0`.

docs/en/sql-reference/10-sql-commands/00-ddl/19-warehouse/drop-warehouse.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ Removes a warehouse and frees up the resources associated with it.
1515
DROP WAREHOUSE [ IF EXISTS ] <warehouse_name>
1616
```
1717

18-
| Parameter | Description |
19-
|-----------|-------------|
20-
| `IF EXISTS` | Optional. If specified, the command succeeds silently when the warehouse does not exist. Without it, the command fails if the warehouse is absent. |
21-
| warehouse_name | The name of the warehouse to remove. |
18+
| Parameter | Description |
19+
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
20+
| `IF EXISTS` | Optional. If specified, the command succeeds silently when the warehouse does not exist. Without it, the command fails if the warehouse is absent. |
21+
| warehouse_name | The name of the warehouse to remove. |
2222

2323
## Examples
2424

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

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,40 +24,40 @@ Tags are key-value pairs that help categorize and organize warehouses, similar t
2424
- **Custom metadata**: Add any arbitrary metadata for organizational purposes
2525

2626
Tag keys and values are arbitrary strings (enclosed in quotes if they contain spaces or special characters). Tags can be:
27+
2728
- Added at warehouse creation time using `WITH TAG (key = 'value', ...)`
2829
- Updated or added later using `ALTER WAREHOUSE ... SET TAG key = 'value'`
2930
- Removed using `ALTER WAREHOUSE ... UNSET TAG key`
3031

3132
Tags are returned in API responses and visible through `SHOW WAREHOUSES`.
3233

3334
**Tag Limits:**
35+
3436
- Maximum 10 tags per warehouse
3537
- Tag name (key) maximum length: 128 characters
3638
- Tag value maximum length: 256 characters
3739

3840
## Supported Statements
3941

40-
| Statement | Purpose | Notes |
41-
| ------------------- | ---------------------------- | ------------------------------------------------------------------- |
42-
| `CREATE WAREHOUSE` | Create a warehouse | Supports `IF NOT EXISTS` and option list |
43-
| `REPLACE WAREHOUSE` | Recreate a warehouse | Same semantics as `CREATE WAREHOUSE`, handy for overwriting configs |
44-
| `ALTER WAREHOUSE` | Suspend/resume/mutate/rename | `SUSPEND`/`RESUME`, `SET <options>`, or `RENAME TO <name>` |
45-
| `DROP WAREHOUSE` | Delete a warehouse | Optional `IF EXISTS` |
46-
| `USE WAREHOUSE` | Bind the current session | Validates existence only |
47-
| `SHOW WAREHOUSES` | List warehouses | Optional `LIKE` filter |
48-
| `QUERY_HISTORY` | Inspect query logs | Filter by warehouse, time range, limit |
42+
| Statement | Purpose | Notes |
43+
| ------------------ | ---------------------------- | ---------------------------------------------------------- |
44+
| `CREATE WAREHOUSE` | Create a warehouse | Supports `IF NOT EXISTS` and option list |
45+
| `ALTER WAREHOUSE` | Suspend/resume/mutate/rename | `SUSPEND`/`RESUME`, `SET <options>`, or `RENAME TO <name>` |
46+
| `DROP WAREHOUSE` | Delete a warehouse | Optional `IF EXISTS` |
47+
| `USE WAREHOUSE` | Bind the current session | Validates existence only |
48+
| `SHOW WAREHOUSES` | List warehouses | Optional `LIKE` filter |
49+
| `QUERY_HISTORY` | Inspect query logs | Filter by warehouse, time range, limit |
4950

5051
## Warehouse Management
5152

52-
| Command | Description |
53-
|---------|-------------|
54-
| [CREATE WAREHOUSE](create-warehouse.md) | Creates a new warehouse |
55-
| [USE WAREHOUSE](use-warehouse.md) | Sets the current warehouse for the session |
56-
| [SHOW WAREHOUSES](show-warehouses.md) | Lists all warehouses with optional filtering |
57-
| [ALTER WAREHOUSE](alter-warehouse.md) | Suspends, resumes, or modifies warehouse settings |
58-
| [DROP WAREHOUSE](drop-warehouse.md) | Removes a warehouse |
59-
| [REPLACE WAREHOUSE](replace-warehouse.md) | Recreates a warehouse with new configuration |
60-
| [QUERY_HISTORY](query-history.md) | Inspects query logs for a warehouse |
53+
| Command | Description |
54+
| --------------------------------------- | ------------------------------------------------- |
55+
| [CREATE WAREHOUSE](create-warehouse.md) | Creates a new warehouse |
56+
| [USE WAREHOUSE](use-warehouse.md) | Sets the current warehouse for the session |
57+
| [SHOW WAREHOUSES](show-warehouses.md) | Lists all warehouses with optional filtering |
58+
| [ALTER WAREHOUSE](alter-warehouse.md) | Suspends, resumes, or modifies warehouse settings |
59+
| [DROP WAREHOUSE](drop-warehouse.md) | Removes a warehouse |
60+
| [QUERY_HISTORY](query-history.md) | Inspects query logs for a warehouse |
6161

6262
:::note
6363
A warehouse represents compute resources used to run queries in Databend Cloud.

docs/en/sql-reference/10-sql-commands/00-ddl/19-warehouse/query-history.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,23 @@ QUERY_HISTORY
1919
[ LIMIT <unsigned_integer> ]
2020
```
2121

22-
| Parameter | Description |
23-
|-----------|-------------|
24-
| `BY WAREHOUSE` | Optional. Filters logs to a specific warehouse. Empty names raise an error. |
25-
| `FROM` | Optional. Start timestamp for the query range. Format: `YYYY-MM-DD HH:MM:SS` (UTC or explicit timezone). Defaults to 1 hour before `TO`. |
26-
| `TO` | Optional. End timestamp for the query range. Format: `YYYY-MM-DD HH:MM:SS` (UTC or explicit timezone). Defaults to current time. |
27-
| `LIMIT` | Optional. Maximum number of records to return. Defaults to `10`. Must be a positive integer. |
22+
| Parameter | Description |
23+
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
24+
| `BY WAREHOUSE` | Optional. Filters logs to a specific warehouse. Empty names raise an error. |
25+
| `FROM` | Optional. Start timestamp for the query range. Format: `YYYY-MM-DD HH:MM:SS` (UTC or explicit timezone). Defaults to 1 hour before `TO`. |
26+
| `TO` | Optional. End timestamp for the query range. Format: `YYYY-MM-DD HH:MM:SS` (UTC or explicit timezone). Defaults to current time. |
27+
| `LIMIT` | Optional. Maximum number of records to return. Defaults to `10`. Must be a positive integer. |
2828

2929
## Output Columns
3030

3131
The result includes columns such as:
3232

33-
| Column | Description |
34-
|--------|-------------|
35-
| `query_id` | Unique identifier for the query |
36-
| `query_text` | The SQL statement executed |
37-
| `scan_bytes` | Amount of data scanned |
38-
| ... | Additional query metrics and metadata |
33+
| Column | Description |
34+
| ------------ | ------------------------------------- |
35+
| `query_id` | Unique identifier for the query |
36+
| `query_text` | The SQL statement executed |
37+
| `scan_bytes` | Amount of data scanned |
38+
| ... | Additional query metrics and metadata |
3939

4040
## Examples
4141

docs/en/sql-reference/10-sql-commands/00-ddl/19-warehouse/replace-warehouse.md

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)