-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexperiment_log.sql
34 lines (34 loc) · 986 Bytes
/
experiment_log.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
-- Schema for the SQLite experiment log
DROP TABLE IF EXISTS result;
CREATE TABLE result (
id INTEGER PRIMARY KEY AUTOINCREMENT,
dbms TEXT NOT NULL,
indexed BOOLEAN NOT NULL,
batch_size INTEGER NOT NULL,
experiment_size INTEGER NOT NULL,
preload_size INTEGER NOT NULL,
run_time FLOAT NOT NULL,
git_hash TEXT NOT NULL,
rows_per_second FLOAT GENERATED ALWAYS AS (ROUND(experiment_size / run_time, 2)) STORED,
ms_per_transaction FLOAT GENERATED ALWAYS AS (
ROUND(
(run_time * 1000) / (experiment_size / batch_size),
2
)
) STORED,
timestamp TEXT DEFAULT CURRENT_TIMESTAMP NOT NULL
);
DROP VIEW IF EXISTS result_summary;
CREATE VIEW result_summary AS
SELECT dbms,
indexed,
batch_size,
ROUND(AVG(run_time), 2) AS avg_run_time,
ROUND(AVG(ms_per_transaction), 2) AS avg_ms_per_transaction,
ROUND(AVG(rows_per_second), 2) AS avg_rows_per_second,
COUNT(*) AS runs
FROM result
GROUP BY dbms,
indexed,
batch_size
ORDER BY batch_size DESC;