Skip to main content

CREATE WORKER

Introduced: v1.3.0

Creates a worker.

note

This command requires cloud control to be enabled.

Syntax

CREATE WORKER [ IF NOT EXISTS ] <worker_name>
[ WITH <option_name> = <option_value> [ , <option_name> = <option_value> ... ] ]

Parameters

ParameterDescription
IF NOT EXISTSOptional. Succeeds without changes if the worker already exists.
<worker_name>The worker name.
<option_name>Worker option key.
<option_value>Worker option value.

Options

Databend accepts a single WITH clause followed by a comma-separated option list. Common worker options include:

OptionExample ValueDescription
size'small'Controls the compute size of the worker.
auto_suspend'300'Idle timeout before automatic suspend.
auto_resume'true'Controls whether the worker resumes automatically.
max_cluster_count'3'Upper bound for auto-scaling clusters.
min_cluster_count'1'Lower bound for auto-scaling clusters.
  • WITH appears at most once.
  • Options are separated by commas.
  • Option names are normalized to lowercase before the request is sent.
  • option_value can be written as a string literal, bare identifier, unsigned integer, or boolean.
  • CREATE WORKER does not support a TAG clause.

Examples

Create a worker without options:

CREATE WORKER read_env;

Create a worker with IF NOT EXISTS:

CREATE WORKER IF NOT EXISTS read_env;

Create a worker with custom options:

CREATE WORKER IF NOT EXISTS read_env
WITH size = 'small',
auto_suspend = '300',
auto_resume = 'true',
max_cluster_count = '3',
min_cluster_count = '1';
Try Databend Cloud for FREE

Multimodal, object-storage-native warehouse for BI, vectors, search, and geo.

Snowflake-compatible SQL with automatic scaling.

Sign up and get $200 in credits.

Try it today