Common Workflows
Controlled experiments you can repeat, share, and gate in CI.
Single-query baseline
- Add a server in the Connections sidebar (if needed), then pick it on the main page to auto-connect and select the database.
- Paste the statement into Query A; set iterations / users from the presets; leave warm-up as needed.
- If the SQL uses variables, Detect @params and set Fixed / Random / Range / Csv values.
- Add a short Change note (e.g. “baseline before index”).
- Leave Cache & Stats unchecked on shared servers.
- Run Benchmark; review avg + P95/P99; use File → Save Scenario (enter a name) or Export.
Compare two query versions
- Open Compare Queries; paste Query A (baseline) and Query B (candidate).
- Use Same database or pick a second database on the same server.
- Set iterations, think time, and cache options for a fair A/B.
- Enable functional validation if results must match.
- Run; review avg / P50–P99, CPU, reads, waits, and plans. Optionally open Query Tuning Assistant for each side. Export PDF/JSON/CSV for the PR.
Load / concurrency test
- Set Users to 10, 25, or 50 from the preset list.
- Under Advanced, set Duration (e.g. 300 / 900 s) and Ramp-up.
- Optional think time (Fixed or Random) to avoid unrealistically aggressive hammering.
- Run; focus on throughput, P95/P99, waits, TempDB, and success rate — not only average duration.
CI / regression gate (CLI)
Full details, outputs, exit codes, and pipeline YAML: CI/CD Pipeline. Quick start:
# Capture a baseline report
DBLenseQueryBenchmark.exe --run -S . -d Sales --sql-file query.sql --iterations 20 --out baseline.json
# Fail the build if the new run is >10% slower on P95; also write JUnit for the test publisher
DBLenseQueryBenchmark.exe --run -S . -d Sales --sql-file query.sql --baseline baseline.json --fail-if-regression 10 --fail-on-p95 --out current.json --out-junit results.junit.xml
Exit codes: 0 ok · 1 error · 2 regression · 3 execution errors. In the GUI: Help → CI/CD Pipeline Integration… for copyable GitHub Actions / Azure DevOps snippets.
Query Tuning Assistant after a run
- Enable Collect actual plan, run the benchmark, then open Tuning Assistant (Results toolbar or Help menu).
- Review Critical / Warning / Info tips from SQL+plan heuristics and live catalog checks.
- Apply changes in a lab, re-benchmark, and compare P95 — see Query Tuning Assistant.
Cross-server / version upgrade test
- Open Dual Environment; pick Env A (current) and Env B (target build or SKU) from saved connections.
- Use the same SQL and parameters on both; align database compatibility intentionally.
- Run equal iterations; compare plans and waits — not just average duration.
Config impact
- Open Config Impact and choose proposed settings (MAXDOP, memory, cost threshold, etc.).
- Run the same query before/after (or with proposed options) on a lab instance.
- Keep production changes out of band — the tool measures impact; it does not push server config for you unless you explicitly apply lab scripts.
Index Analysis (lab only)
- Open Index Analysis on an isolated / lab SQL Server (never production).
- Paste the query to measure and a candidate
CREATE INDEXstatement in the Index DDL pane. - Confirm the lab warning, then run. The tool benchmarks without the index, creates it, benchmarks with it, captures plans for both sides, then drops the index (best-effort).
- Review Insights, KPI deltas, iteration grid, and Open Plan Comparison. Export or save a scenario for the PR.
ON Sales.SalesOrderDetail.
Save & load scenarios
- Configure the workspace (Benchmark, Compare Queries, Index Analysis, …), connections, SQL, parameters, and options.
- File → Save Scenario — stores Query A, Query B (compare), Index DDL (index analysis), workspace tab, config, and parameters.
- File → Load Scenario restores the correct tab and both editor panes so you can re-run after a code change.
- Export the scenario JSON for CI with
--scenario path.json(see CI/CD Pipeline).