---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://ydb.tech/docs/en/reference/ydb-cli/workload-tpcds.md?version=v25.4
  - https://ydb.tech/docs/ru/reference/ydb-cli/workload-tpcds.md?version=v25.4
  - href: en/reference/ydb-cli/workload-tpcds.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/core/reference/ydb-cli/workload-tpcds.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# TPC-DS workload

The workload is based on the TPC-DS [specification](https://www.tpc.org/TPC_Documents_Current_Versions/pdf/TPC-DS_v3.2.0.pdf), with the queries and table schemas adapted for YDB.

This benchmark generates a workload typical for decision support systems.

## Common command options

All commands support the common option `--path`, which specifies the path to the directory containing benchmark tables in the database:

```bash
ydb workload tpcds --path tpcds/s1 ...
```

### Available options { #common_options }

| Name              | Description                         | Default value |
|-------------------|-------------------------------------|---------------|
| `--path` or `-p` | Path to the directory with tables.   | `/`           |

## Initializing the load test {#init}

Before running the benchmark, create a table:

```bash
ydb workload tpcds --path tpcds/s1 init
```

See the command description to run the load:

```bash
ydb workload tpcds init --help
```

<!-- source: en/reference/ydb-cli/_includes/workload/init_options_tpc.md -->
### Available parameters {#init_options}

| Name                         | Description                                                                                                                                                                                                                                                                          | Default value        |
|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
| `--store <value>`                   | Table storage type. Possible values: `row`, `column`, `external-s3`.                                                                                                                                                                                                                         | `row`                |
| `--external-s3-prefix <value>`      | Relevant only for external tables. Root path to the dataset in S3 storage.                                                                                                                                                                                                                   |                      |
| `--external-s3-endpoint <value>` or `-e <value>` | Relevant only for external tables. Link to the S3 bucket with data.                                                                                                                                                                                                                      |                      |
| `--string`                          | Use the `String` type for text fields.                                                                                                                                                                                                                                                       | `Utf8`               |
| `--datetime`                        | Use for time-related fields of type `Date`, `Datetime`, and `Timestamp`.                                                                                                                                                                                                                     | `Date32`, `Datetime64`, `Timestamp64` |
|  `--partition-size` | Maximum partition size in megabytes (AUTO_PARTITIONING_PARTITION_SIZE_MB) for row tables. | 2000 |
| `--float-mode <value>`              | Specifies the data type to use for fractional fields. Possible values are `double` and `decimal`. `double` uses the `Double` type, `decimal` uses `Decimal` with dimensions specified by the test standard. | `double`              |
| `--scale` | Sets the percentage of the benchmark's data size and workload to use, relative to full scale. | 1 |
| `--clear`                           | If the table at the specified path already exists, it will be deleted.                                                                                                                                                                                                                       |                      |
<!-- endsource: en/reference/ydb-cli/_includes/workload/init_options_tpc.md -->

## Loading data into the table { #load }

The data will be generated and loaded into the table directly by YDB CLI:

```bash
ydb workload tpcds --path tpcds/s1 import generator --scale 1
```

See the command description:

```bash
ydb workload tpcds import --help
```

### Available options {#load_files_options}

| Name                                  | Description                                                                                                                                       | Default value |
|---------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|---------------|
| `--scale <value>`                     | Data scale. Typically, powers of ten are used.                                                                                                    |               |
| `--tables <value>`                    | Comma-separated list of tables to generate. Available tables: `customer`, `nation`, `order_line`, `part_psupp`, `region`, `supplier`.             | All tables    |
| `--process-count <value>` or `-C <value>` | Specifies the number of processes for parallel data generation.                                                                               | `1`           |
| `--process-index <value>` or `-i <value>` | Specifies the process number when data generation is split into multiple processes.                                                           | `0`           |
| `--state <path>`                      | Path to the state file for resuming generation. If the generation is interrupted, it will resume from the same point when restarted.              |               |
| `--clear-state`                       | Relevant if the `--state` parameter is specified. Clears the state file and restarts the download from the beginning.                             |               |

<!-- source: en/reference/ydb-cli/_includes/workload/load_options.md -->
### Common parameters of the import command {#load_options}

| Name                            | Description                                                                                                                   | Default value                        |
|----------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `--upload-threads <value>` or `-t <value>` | The number of execution threads for data preparation.                                                                                 | The number of available cores on the client.  |
| `--bulk-size <value>`                  | The size of the chunk for sending data, in rows.                                                                                       | 10000                               |
| `--max-in-flight <value>`              | The maximum number of data chunks that can be processed simultaneously.                                                                | 128                                  |
<!-- endsource: en/reference/ydb-cli/_includes/workload/load_options.md -->

## Run the load test { #run }

Run the load:

```bash
ydb workload tpcds --path tpcds/s1 run
```

During the benchmark, load statistics are displayed for each request.

See the command description:

```bash
ydb workload tpcds run --help
```

<!-- source: en/reference/ydb-cli/_includes/workload/run_options.md -->
### Common parameters for all load types {#run_options}

| Name                              | Description                                                                                                                                                                   | Default value                        |
|------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------|
| `--output <value>`                       | The name of the file where the query execution results will be saved.                                                                                                                | `results.out`                        |
| `--iterations <value>`                   | The number of times each load query will be executed.                                                                                                                                 | `1`                                  |
| `--json <name>`                          | The name of the file where query execution statistics will be saved in `json` format.                                                                                                | Not saved by default                 |
| `--ministat <name>`                      | The name of the file where query execution statistics will be saved in `ministat` format.                                                                                            | Not saved by default                 |
| `--plan <name>`                          | The name of the file to save the query plan. Files like `<name>.<query number>.explain` and `<name>.<query number>.<iteration number>` will be saved in formats: `ast`, `json`, `svg`. | Not saved by default                 |
| `--query-prefix <setting>`             | Query prefix. Every prefix is a line that will be added to the beginning of each query. For multiple prefix lines use this option several times. | Not specified by default             |
`--retries` | Max retry count for every request. | `0`
| `--include`                              | Query numbers or segments to be executed as part of the load.                                                                                                                         | All queries executed                 |
| `--exclude`                              | Query numbers or segments to be excluded from the load.                                                                                                                               | None excluded by default             |
| `--executer`                             | Query execution engine. Available values: `scan`, `generic`.                                                                                                                          | `generic`                            |
| `--verbose` or `-v`                      | Print additional information to the screen during query execution.                                                                                                                    |                                      |
| `--threads <value>` or `-t <value>` | The number of parallel threads generatibg the load |
<!-- endsource: en/reference/ydb-cli/_includes/workload/run_options.md -->

### TPC-DS-specific options { #run_tpcds_options }

| Name                       | Description                                                                                         | Default value |
|----------------------------|-----------------------------------------------------------------------------------------------------|---------------|
| `--ext-query-dir <name>`   | Directory with external queries for load execution. Queries should be in files named `q[1-99].sql`. |               |

## Test data cleanup { #cleanup }

Run cleanup:

```bash
ydb workload tpcds --path tpcds/s1 clean
```

The command has no parameters.
