view_queries.sql 9.78 KB
Newer Older
1
2
3
4
5
6
7
-- Sentiment ted_apted average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS sentiment_apted_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW sentiment_apted_x_avg_pair_tree_size_y_avg_runtime_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
  FROM ted_apted NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'sentiment_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
8
9
10
11
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

12
13
14
15
16
17
18
19
20
21
22
-- Sentiment ted_cted average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS sentiment_cted_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW sentiment_cted_x_avg_pair_tree_size_y_avg_runtime_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
  FROM ted_cted NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'sentiment_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

23
24
25
26
27
28
29
30
-- Sentiment tedk_labelguided average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS sentiment_labelguided_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW sentiment_labelguided_x_avg_pair_tree_size_y_avg_runtime_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
  FROM tedk_labelguided NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'sentiment_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
  AND ted_threshold = 10
31
32
33
34
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

35
-- Sentiment tedk_touzetd average runtime per average size in tree pair k10.
36
37
DROP MATERIALIZED VIEW IF EXISTS sentiment_touzetd_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW sentiment_touzetd_x_avg_pair_tree_size_y_avg_runtime_k10 AS
38
39
40
41
42
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
  FROM tedk_touzetd NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'sentiment_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
  AND ted_threshold = 10
43
44
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
Mateusz Pawlik's avatar
Mateusz Pawlik committed
45
46
WITH DATA;

47
48
49
50
51
52
-- DBLP ted_apted average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS dblp_apted_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW dblp_apted_x_avg_pair_tree_size_y_avg_runtime_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
  FROM ted_apted NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
53
54
55
56
57
58
59
60
61
62
63
  AND abs(tree_size_1-tree_size_2)<=10
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

-- DBLP ted_cted average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS dblp_cted_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW dblp_cted_x_avg_pair_tree_size_y_avg_runtime_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
  FROM ted_cted NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
64
  AND abs(tree_size_1-tree_size_2)<=10
Mateusz Pawlik's avatar
Mateusz Pawlik committed
65
66
67
68
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

69
70
71
72
73
74
75
76
-- DBLP tedk_labelguided average runtime per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS dblp_labelguided_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW dblp_labelguided_x_avg_pair_tree_size_y_avg_runtime_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
  FROM tedk_labelguided NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
  AND ted_threshold = 10
Mateusz Pawlik's avatar
Mateusz Pawlik committed
77
78
79
80
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

81
-- DBLP tedk_touzetd average runtime per average size in tree pair k10.
Mateusz Pawlik's avatar
Mateusz Pawlik committed
82
83
DROP MATERIALIZED VIEW IF EXISTS dblp_touzetd_x_avg_pair_tree_size_y_avg_runtime_k10;
CREATE MATERIALIZED VIEW dblp_touzetd_x_avg_pair_tree_size_y_avg_runtime_k10 AS
84
85
86
87
88
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(runtime) AS avg_runtime
  FROM tedk_touzetd NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
  AND ted_threshold = 10
89
90
91
92
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

93
-- Sentiment ted_apted average ted value per average size in tree pair k10.
Mateusz Pawlik's avatar
Mateusz Pawlik committed
94
DROP MATERIALIZED VIEW IF EXISTS sentiment_apted_x_avg_pair_tree_size_y_avg_ted_k10 CASCADE;
95
96
97
98
99
CREATE MATERIALIZED VIEW sentiment_apted_x_avg_pair_tree_size_y_avg_ted_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(ted_value) AS avg_ted_value
  FROM ted_apted NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'sentiment_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
100
101
102
103
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

104
-- Sentiment tedk_labelguided average ted value per average size in tree pair k10.
Mateusz Pawlik's avatar
Mateusz Pawlik committed
105
DROP MATERIALIZED VIEW IF EXISTS sentiment_labelguided_x_avg_pair_tree_size_y_avg_ted_k10 CASCADE;
106
107
108
109
110
CREATE MATERIALIZED VIEW sentiment_labelguided_x_avg_pair_tree_size_y_avg_ted_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(ted_value) AS avg_ted_value
  FROM tedk_labelguided NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'sentiment_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
Mateusz Pawlik's avatar
Mateusz Pawlik committed
111
  AND ted_threshold = 10
Mateusz Pawlik's avatar
Mateusz Pawlik committed
112
113
114
115
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

Mateusz Pawlik's avatar
Mateusz Pawlik committed
116
-- Sentiment Error: (ub-ted)/ted
117
118
119
120
121
122
DROP MATERIALIZED VIEW IF EXISTS sentiment_labelguided_x_avg_pair_tree_size_y_ted_error_k10;
CREATE MATERIALIZED VIEW sentiment_labelguided_x_avg_pair_tree_size_y_ted_error_k10 AS
  SELECT l.avg_pair_tree_size, a.avg_ted_value/a.avg_pair_tree_size AS dis, (l.avg_ted_value-a.avg_ted_value)/(a.avg_ted_value) AS error
  FROM sentiment_labelguided_x_avg_pair_tree_size_y_avg_ted_k10 AS l
  JOIN sentiment_apted_x_avg_pair_tree_size_y_avg_ted_k10 AS a
  ON l.avg_pair_tree_size=a.avg_pair_tree_size
123
124
WITH DATA;

125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
-- Sentiment ted_cted average ted value per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS sentiment_cted_x_avg_pair_tree_size_y_avg_ted_k10 CASCADE;
CREATE MATERIALIZED VIEW sentiment_cted_x_avg_pair_tree_size_y_avg_ted_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(ted_value) AS avg_ted_value
  FROM ted_cted NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'sentiment_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

-- Sentiment Error: (ub-ted)/ted
DROP MATERIALIZED VIEW IF EXISTS sentiment_cted_x_avg_pair_tree_size_y_ted_error_k10;
CREATE MATERIALIZED VIEW sentiment_cted_x_avg_pair_tree_size_y_ted_error_k10 AS
  SELECT l.avg_pair_tree_size, a.avg_ted_value/a.avg_pair_tree_size AS dis, (l.avg_ted_value-a.avg_ted_value)/(a.avg_ted_value) AS error
  FROM sentiment_cted_x_avg_pair_tree_size_y_avg_ted_k10 AS l
  JOIN sentiment_apted_x_avg_pair_tree_size_y_avg_ted_k10 AS a
  ON l.avg_pair_tree_size=a.avg_pair_tree_size
WITH DATA;

145
-- DBLP ted_apted average ted value per average size in tree pair k10.
Mateusz Pawlik's avatar
Mateusz Pawlik committed
146
147
148
149
150
151
DROP MATERIALIZED VIEW IF EXISTS dblp_apted_x_avg_pair_tree_size_y_avg_ted_k10 CASCADE;
CREATE MATERIALIZED VIEW dblp_apted_x_avg_pair_tree_size_y_avg_ted_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(ted_value) AS avg_ted_value
  FROM ted_apted NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
Mateusz Pawlik's avatar
Mateusz Pawlik committed
152
153
154
155
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

156
-- DBLP tedk_labelguided average ted value per average size in tree pair k10.
Mateusz Pawlik's avatar
Mateusz Pawlik committed
157
158
159
160
161
162
163
DROP MATERIALIZED VIEW IF EXISTS dblp_labelguided_x_avg_pair_tree_size_y_avg_ted_k10 CASCADE;
CREATE MATERIALIZED VIEW dblp_labelguided_x_avg_pair_tree_size_y_avg_ted_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(ted_value) AS avg_ted_value
  FROM tedk_labelguided NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
  AND ted_threshold = 10
Mateusz Pawlik's avatar
Mateusz Pawlik committed
164
165
166
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;
167

Mateusz Pawlik's avatar
Mateusz Pawlik committed
168
-- DBLP Error: (ub-ted)/ted
169
170
171
DROP MATERIALIZED VIEW IF EXISTS dblp_labelguided_x_avg_pair_tree_size_y_ted_error_k10;
CREATE MATERIALIZED VIEW dblp_labelguided_x_avg_pair_tree_size_y_ted_error_k10 AS
  SELECT l.avg_pair_tree_size, a.avg_ted_value/a.avg_pair_tree_size AS dis, (l.avg_ted_value-a.avg_ted_value)/(a.avg_ted_value) AS error
Mateusz Pawlik's avatar
Mateusz Pawlik committed
172
173
174
  FROM dblp_labelguided_x_avg_pair_tree_size_y_avg_ted_k10 AS l
  JOIN dblp_apted_x_avg_pair_tree_size_y_avg_ted_k10 AS a
  ON l.avg_pair_tree_size=a.avg_pair_tree_size
175
WITH DATA;
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195

-- DBLP ted_cted average ted value per average size in tree pair k10.
DROP MATERIALIZED VIEW IF EXISTS dblp_cted_x_avg_pair_tree_size_y_avg_ted_k10 CASCADE;
CREATE MATERIALIZED VIEW dblp_cted_x_avg_pair_tree_size_y_avg_ted_k10 AS
  SELECT (tree_size_1+tree_size_2)/2.0 AS avg_pair_tree_size, avg(ted_value) AS avg_ted_value
  FROM ted_cted NATURAL JOIN ted_experiment_params
  WHERE dataset_filename = 'dblp_no_www_sorted.bracket'
  AND abs(tree_size_1-tree_size_2)<=10
  GROUP BY avg_pair_tree_size
  ORDER BY avg_pair_tree_size
WITH DATA;

-- DBLP Error: (ub-ted)/ted
DROP MATERIALIZED VIEW IF EXISTS dblp_cted_x_avg_pair_tree_size_y_ted_error_k10;
CREATE MATERIALIZED VIEW dblp_cted_x_avg_pair_tree_size_y_ted_error_k10 AS
  SELECT l.avg_pair_tree_size, a.avg_ted_value/a.avg_pair_tree_size AS dis, (l.avg_ted_value-a.avg_ted_value)/(a.avg_ted_value) AS error
  FROM dblp_cted_x_avg_pair_tree_size_y_avg_ted_k10 AS l
  JOIN dblp_apted_x_avg_pair_tree_size_y_avg_ted_k10 AS a
  ON l.avg_pair_tree_size=a.avg_pair_tree_size
WITH DATA;