Merge pull request #38723 from ClickHouse/hardware-benchmark-example-query

Add example query to hardware benchmark
This commit is contained in:
Alexey Milovidov 2022-07-02 20:25:52 +03:00 committed by GitHub
commit 4d9e3469d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -217,4 +217,31 @@ TO benchmark;
GRANT INSERT ON benchmark_runs TO benchmark;
GRANT INSERT ON benchmark_results TO benchmark;
Example query:
SELECT
cpu_model,
threads,
instance,
k
FROM
(
SELECT
run_id,
exp(avg(log(adjusted_time / best_time))) AS k
FROM
(
WITH greatest(time, 0.01) AS adjusted_time
SELECT
run_id,
adjusted_time,
min(adjusted_time) OVER (PARTITION BY query_num, try_num) AS best_time
FROM benchmark_results
WHERE try_num > 1
)
GROUP BY run_id
ORDER BY k ASC
) AS t
INNER JOIN benchmark_runs USING (run_id)
////