workload_define
Create or replace a saved test workload (it can then be run with workload_run, again and again).
Instructions
Create or replace a saved test workload (it can then be run with workload_run, again and again).
Args:
name: Workload name (letters, digits, spaces, . - _).
statements: [{"sql": "...", "per_minute": 30, "name": "Top makes", "database": null, "id": "s1",
"enabled": true}]. per_minute is how often the statement runs (with pacing "max": its relative
weight). SQL may use placeholders filled per execution: {{int:1:1000}}, {{float:0:1}},
{{pick:a|b|c}}, {{date:2024-01-01:2024-12-31}} (quote strings yourself: '{{pick:US|EU}}').
database: Default database for the statements.
pacing: "rate" (each statement per_minute times a minute) or "max" (as fast as the connections can).
concurrency: Connections (parallel workers), 1-64.
duration_s: How long a run lasts, 5 s - 4 h.
timeout_s: Per-statement timeout; the statement is cancelled (KILL QUERY) after it.
arrivals: "even" (fixed spacing) or "random" (Poisson arrivals at the same average rate).
think_ms: Pause between statements per worker (pacing "max").
fetch_rows: Read every result row (off measures just the execute time, not the time to read rows back).
allow_writes: Allow statements other than SELECT / WITH (they run repeatedly: use a test table).
trace_all: Turn on full query tracing on the cluster for the run, so every statement (not just those
over the trace threshold) shows up in Query History afterwards. Affects the whole cluster.
original_name: The workload's current name when renaming it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| pacing | No | rate | |
| arrivals | No | even | |
| database | No | ||
| think_ms | No | ||
| timeout_s | No | ||
| trace_all | No | ||
| duration_s | No | ||
| fetch_rows | No | ||
| statements | Yes | ||
| concurrency | No | ||
| description | No | ||
| allow_writes | No | ||
| original_name | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||