You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/cli.md
+48-10Lines changed: 48 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,31 +64,69 @@ basic_auth.password = "Pass"
64
64
65
65
## Benchmark Queries
66
66
67
-
You can benchmark queries by adding the `--bench` parameter. This will run the query a configurable number of times and output a breakdown of the queries execution time with summary statistics for each component of the query (logical planning, physical planning, execution time, and total time).
67
+
You can benchmark queries by adding the `--bench` parameter. This will run the query a configurable number of times and output a breakdown of the query's execution time with summary statistics for each component (logical planning, physical planning, execution time, and total time).
68
68
69
-
Optionally you can use the `--run-before` param to run a query before the benchmark is run. This is useful in cases where you want to hit a temp table or write a file to disk that your benchmark query will use.
69
+
### Benchmark Modes
70
70
71
-
To save benchmark results to a file use the `--save` parameter with a file path. Further, you can use the `--append` parameter to append to the file instead of overwriting it.
71
+
**Serial Benchmark (default):**
72
+
Measures query performance in isolation, running iterations one after another. This shows the pure query execution time without any contention or resource sharing overhead.
72
73
73
-
The number of benchmark iterations is defined in your configuration (default is 10) and can be configured per benchmark run with `-n` parameter.
74
+
**Concurrent Benchmark (`--concurrent`):**
75
+
Measures query performance under load by running iterations in parallel. This reveals:
76
+
- Throughput (queries per second) with multiple concurrent clients
77
+
- Resource contention and bottlenecks
78
+
- Performance degradation under concurrent load
74
79
80
+
Concurrent mode uses adaptive concurrency: `min(iterations, CPU cores)` to avoid overwhelming the system.
81
+
82
+
### Options
83
+
84
+
-**`--bench`**: Enable benchmarking mode
85
+
-**`--concurrent`**: Run iterations in parallel (for concurrent benchmarking)
86
+
-**`-n <count>`**: Number of iterations (default: 10, configured in config file)
87
+
-**`--run-before <query>`**: Run a setup query before benchmarking (useful for cache warming)
88
+
-**`--save <file>`**: Save results to CSV file
89
+
-**`--append`**: Append to existing results file instead of overwriting
90
+
91
+
### Examples
75
92
76
93
```sh
94
+
# Serial benchmark (default)
77
95
dft -c "SELECT * FROM my_table" --bench
78
96
79
-
# Run a configurable number of benchmark iterations
80
-
dft -c "SELECT ..." --bench -n 5
97
+
# Concurrent benchmark
98
+
dft -c "SELECT * FROM my_table" --bench --concurrent
-**Row counts**: Validation that all runs returned the same number of rows
126
+
-**CSV format**: Results include a `concurrency_mode` column for comparison
127
+
128
+
**Note**: Concurrent benchmarks typically show higher mean/median times due to resource contention - this is expected and reveals how the system performs under load.
129
+
92
130
## Analyze Queries
93
131
94
132
The output from `EXPLAIN ANALYZE` provides a wealth of information on a queries execution - however, the amount of information and connecting the dots can be difficult and manual. Further, there is detail in the `MetricSet`'s of the underlying `ExecutionPlan`'s that is lost in the output.
0 commit comments