Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
352 changes: 336 additions & 16 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion aqpbm-cli/src/benchmark_external_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub struct RunArgs {
#[arg(long)]
pub run_directory: PathBuf,
/// The engine: `fake` (the harness's own fake engine), `clickhouse`,
/// `victoriametrics` or `asapquery-backend`.
/// `victoriametrics`, `asapquery-backend` or `postgresql` (TimescaleDB).
#[arg(long)]
pub engine: String,
/// Only these variants (repeatable); every variant under plans/ by default.
Expand Down
3 changes: 2 additions & 1 deletion docs/system-bench.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Not every system supports every measurement:
|---|---|---|---|
| `duckdb` | | yes | |
| `clickhouse` | yes | yes | |
| `postgresql` (with TimescaleDB) | | yes | |
| `postgresql` (with TimescaleDB) | yes | yes | |
| `druid` | | yes | |
| `pilotdb` (over DuckDB) | | yes | |
| `victoriametrics` | yes | | |
Expand All @@ -39,6 +39,7 @@ What to run comes from a run directory: the workloads, and the plans if a system
`scripts/plan-suite.sh` prepares a run directory from a suite.
`scripts/one-shot-workload.sh` and `scripts/one-shot-clickbench.sh` prepare one and run every system for one-shot queries.
`scripts/write-throughput-asapquery-precompute-engine.sh` measures the write throughput of an ASAPQuery precompute engine.
`scripts/timescaledb-variants.sh` adds the TimescaleDB variants to a run directory: `postgresql` runs each query's PromQL text over a hypertable, over continuous aggregates, or with the Toolkit's quantile sketches, as its adapter's module docs say.

## Output

Expand Down
35 changes: 35 additions & 0 deletions scripts/timescaledb-variants.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env bash
# Add the TimescaleDB variants to a benchmark-external run directory, for
# `approxbench benchmark-external run --engine postgresql --variant <name>`.
#
# scripts/timescaledb-variants.sh <run-directory>
#
# Each variant runs every workload query's PromQL text (no plan file, "plans": false) and
# runs only when named with --variant ("run_by_default": false), so the other engines'
# runs over the same directory skip it. What each variant computes is in the module docs
# of system-bench/src/engines_external/timescaledb_server.rs:
# timescaledb.hypertable exact, at query time over the raw hypertable
# timescaledb.continuous-aggregate exact, one continuous aggregate per query
# timescaledb.uddsketch quantiles by uddsketch at query time
# timescaledb.tdigest quantiles by tdigest at query time
# timescaledb.continuous-aggregate.uddsketch quantiles by uddsketch per bucket
# timescaledb.continuous-aggregate.tdigest quantiles by tdigest per bucket
#
# Example: scripts/timescaledb-variants.sh /data/run-1
set -euo pipefail

run=${1:?run directory}
[ -d "$run/workloads" ] || { echo "$run has no workloads/" >&2; exit 1; }
for line in \
"timescaledb.hypertable false" \
"timescaledb.continuous-aggregate false" \
"timescaledb.uddsketch true" \
"timescaledb.tdigest true" \
"timescaledb.continuous-aggregate.uddsketch true" \
"timescaledb.continuous-aggregate.tdigest true"; do
read -r variant substitutions <<<"$line"
[ -e "$run/plans/$variant" ] && { echo "$run/plans/$variant exists" >&2; exit 1; }
mkdir -p "$run/plans/$variant"
printf '{"substitutions_allowed": %s, "plans": false, "run_by_default": false}\n' "$substitutions" \
> "$run/plans/$variant/variant.json"
done
1 change: 1 addition & 0 deletions system-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ thiserror.workspace = true
prost = "0.13"
snap = "1.1"
ureq = { version = "2", default-features = false }
postgres = "0.19"

[dev-dependencies]
aqpbm-datagen.workspace = true
1 change: 1 addition & 0 deletions system-bench/src/engines_external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub mod plan_file;
pub mod postgresql_command_line;
mod restart_command;
pub mod server_cgroup;
pub mod timescaledb_server;
pub mod victoriametrics;
pub mod victoriametrics_server;

Expand Down
Loading