-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
60 lines (60 loc) · 2.63 KB
/
schema.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
--------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS benchmarks
(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
name VARCHAR(256) UNIQUE NOT NULL
);
--------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS queries
(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
benchmark_id INTEGER REFERENCES benchmarks NOT NULL,
query_path varchar(256) NOT NULL,
result_fingerprint INTEGER DEFAULT 0
);
--------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS query_required_optimizers
(
query_id INTEGER REFERENCES queries NOT NULL,
optimizer TEXT NOT NULL,
PRIMARY KEY (query_id, optimizer)
);
--------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS query_effective_optimizers
(
query_id INTEGER REFERENCES queries NOT NULL,
optimizer TEXT NOT NULL,
PRIMARY KEY (query_id, optimizer)
);
--------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS query_effective_optimizers_dependencies
(
query_id INTEGER REFERENCES queries NOT NULL,
optimizer TEXT NOT NULL,
dependent_optimizer TEXT NOT NULL, -- dependency of 'optimizer'
PRIMARY KEY (query_id, optimizer, dependent_optimizer)
);
--------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS query_optimizer_configs
(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
query_id INTEGER REFERENCES queries NOT NULL,
disabled_rules TEXT NOT NULL, -- this column represents exactly one hint-set
query_plan TEXT NOT NULL,
num_disabled_rules INTEGER NOT NULL,
hash INTEGER NOT NULL, -- the hash value of the optimizer query plan
duplicated_plan BOOLEAN DEFAULT FALSE NOT NULL,
UNIQUE (query_id, disabled_rules)
);
--------------------------------------------------------------------------------
CREATE TABLE IF NOT EXISTS measurements
(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL ,
query_optimizer_config_id INTEGER REFERENCES query_optimizer_configs NOT NULL,
walltime INTEGER NOT NULL,
machine TEXT NOT NULL,
time TIMESTAMP NOT NULL,
input_data_size INTEGER NOT NULL,
num_compute_nodes INTEGER NOT NULL
);
--------------------------------------------------------------------------------