1#include "benchmark_runner.hpp"
2#include "compare_result.hpp"
3#include "dsdgen.hpp"
4#include "duckdb_benchmark_macro.hpp"
5
6using namespace duckdb;
7using namespace std;
8
9#define SF 1
10
11#define TPCDS_QUERY_BODY(QNR) \
12 virtual void Load(DuckDBBenchmarkState *state) { \
13 if (!BenchmarkRunner::TryLoadDatabase(state->db, "tpcds")) { \
14 tpcds::dbgen(SF, state->db); \
15 BenchmarkRunner::SaveDatabase(state->db, "tpcds"); \
16 } \
17 } \
18 virtual string GetQuery() { \
19 return tpcds::get_query(QNR); \
20 } \
21 virtual string VerifyResult(QueryResult *result) { \
22 if (!result->success) { \
23 return result->error; \
24 } \
25 return ""; /*return compare_csv(*result, tpch::get_answer(SF, QNR), \
26 true); */ \
27 } \
28 virtual string BenchmarkInfo() { \
29 return StringUtil::Format("TPC-DS Q%d SF%d: %s", QNR, SF, tpcds::get_query(QNR).c_str()); \
30 }
31
32DUCKDB_BENCHMARK(DSQ001, "[tpcds-sf1]")
33TPCDS_QUERY_BODY(1);
34FINISH_BENCHMARK(DSQ001);
35
36DUCKDB_BENCHMARK(DSQ002, "[tpcds-sf1]")
37TPCDS_QUERY_BODY(2);
38FINISH_BENCHMARK(DSQ002);
39
40DUCKDB_BENCHMARK(DSQ003, "[tpcds-sf1]")
41TPCDS_QUERY_BODY(3);
42FINISH_BENCHMARK(DSQ003);
43
44DUCKDB_BENCHMARK(DSQ004, "[tpcds-sf1]")
45TPCDS_QUERY_BODY(4);
46FINISH_BENCHMARK(DSQ004);
47
48DUCKDB_BENCHMARK(DSQ005, "[tpcds-sf1]")
49TPCDS_QUERY_BODY(5);
50FINISH_BENCHMARK(DSQ005);
51
52DUCKDB_BENCHMARK(DSQ006, "[tpcds-sf1]")
53TPCDS_QUERY_BODY(6);
54FINISH_BENCHMARK(DSQ006);
55
56DUCKDB_BENCHMARK(DSQ007, "[tpcds-sf1]")
57TPCDS_QUERY_BODY(7);
58FINISH_BENCHMARK(DSQ007);
59
60DUCKDB_BENCHMARK(DSQ008, "[tpcds-sf1]")
61TPCDS_QUERY_BODY(8);
62FINISH_BENCHMARK(DSQ008);
63
64DUCKDB_BENCHMARK(DSQ009, "[tpcds-sf1]")
65TPCDS_QUERY_BODY(9);
66FINISH_BENCHMARK(DSQ009);
67
68DUCKDB_BENCHMARK(DSQ010, "[tpcds-sf1]")
69TPCDS_QUERY_BODY(10);
70FINISH_BENCHMARK(DSQ010);
71
72DUCKDB_BENCHMARK(DSQ011, "[tpcds-sf1]")
73TPCDS_QUERY_BODY(11);
74FINISH_BENCHMARK(DSQ011);
75
76DUCKDB_BENCHMARK(DSQ012, "[tpcds-sf1]")
77TPCDS_QUERY_BODY(12);
78FINISH_BENCHMARK(DSQ012);
79
80DUCKDB_BENCHMARK(DSQ013, "[tpcds-sf1]")
81TPCDS_QUERY_BODY(13);
82FINISH_BENCHMARK(DSQ013);
83
84DUCKDB_BENCHMARK(DSQ014, "[tpcds-sf1]")
85TPCDS_QUERY_BODY(14);
86FINISH_BENCHMARK(DSQ014);
87
88DUCKDB_BENCHMARK(DSQ015, "[tpcds-sf1]")
89TPCDS_QUERY_BODY(15);
90FINISH_BENCHMARK(DSQ015);
91
92DUCKDB_BENCHMARK(DSQ016, "[tpcds-sf1]")
93TPCDS_QUERY_BODY(16);
94FINISH_BENCHMARK(DSQ016);
95
96DUCKDB_BENCHMARK(DSQ017, "[tpcds-sf1]")
97TPCDS_QUERY_BODY(17);
98FINISH_BENCHMARK(DSQ017);
99
100DUCKDB_BENCHMARK(DSQ018, "[tpcds-sf1]")
101TPCDS_QUERY_BODY(18);
102FINISH_BENCHMARK(DSQ018);
103
104DUCKDB_BENCHMARK(DSQ019, "[tpcds-sf1]")
105TPCDS_QUERY_BODY(19);
106FINISH_BENCHMARK(DSQ019);
107
108DUCKDB_BENCHMARK(DSQ020, "[tpcds-sf1]")
109TPCDS_QUERY_BODY(20);
110FINISH_BENCHMARK(DSQ020);
111
112DUCKDB_BENCHMARK(DSQ021, "[tpcds-sf1]")
113TPCDS_QUERY_BODY(21);
114FINISH_BENCHMARK(DSQ021);
115
116DUCKDB_BENCHMARK(DSQ022, "[tpcds-sf1]")
117TPCDS_QUERY_BODY(22);
118FINISH_BENCHMARK(DSQ022);
119
120DUCKDB_BENCHMARK(DSQ023, "[tpcds-sf1]")
121TPCDS_QUERY_BODY(23);
122FINISH_BENCHMARK(DSQ023);
123
124DUCKDB_BENCHMARK(DSQ024, "[tpcds-sf1]")
125TPCDS_QUERY_BODY(24);
126FINISH_BENCHMARK(DSQ024);
127
128DUCKDB_BENCHMARK(DSQ025, "[tpcds-sf1]")
129TPCDS_QUERY_BODY(25);
130FINISH_BENCHMARK(DSQ025);
131
132DUCKDB_BENCHMARK(DSQ026, "[tpcds-sf1]")
133TPCDS_QUERY_BODY(26);
134FINISH_BENCHMARK(DSQ026);
135
136DUCKDB_BENCHMARK(DSQ027, "[tpcds-sf1]")
137TPCDS_QUERY_BODY(27);
138FINISH_BENCHMARK(DSQ027);
139
140DUCKDB_BENCHMARK(DSQ028, "[tpcds-sf1]")
141TPCDS_QUERY_BODY(28);
142FINISH_BENCHMARK(DSQ028);
143
144DUCKDB_BENCHMARK(DSQ029, "[tpcds-sf1]")
145TPCDS_QUERY_BODY(29);
146FINISH_BENCHMARK(DSQ029);
147
148DUCKDB_BENCHMARK(DSQ030, "[tpcds-sf1]")
149TPCDS_QUERY_BODY(30);
150FINISH_BENCHMARK(DSQ030);
151
152DUCKDB_BENCHMARK(DSQ031, "[tpcds-sf1]")
153TPCDS_QUERY_BODY(31);
154FINISH_BENCHMARK(DSQ031);
155
156DUCKDB_BENCHMARK(DSQ032, "[tpcds-sf1]")
157TPCDS_QUERY_BODY(32);
158FINISH_BENCHMARK(DSQ032);
159
160DUCKDB_BENCHMARK(DSQ033, "[tpcds-sf1]")
161TPCDS_QUERY_BODY(33);
162FINISH_BENCHMARK(DSQ033);
163
164DUCKDB_BENCHMARK(DSQ034, "[tpcds-sf1]")
165TPCDS_QUERY_BODY(34);
166FINISH_BENCHMARK(DSQ034);
167
168DUCKDB_BENCHMARK(DSQ035, "[tpcds-sf1]")
169TPCDS_QUERY_BODY(35);
170FINISH_BENCHMARK(DSQ035);
171
172DUCKDB_BENCHMARK(DSQ036, "[tpcds-sf1]")
173TPCDS_QUERY_BODY(36);
174FINISH_BENCHMARK(DSQ036);
175
176DUCKDB_BENCHMARK(DSQ037, "[tpcds-sf1]")
177TPCDS_QUERY_BODY(37);
178FINISH_BENCHMARK(DSQ037);
179
180DUCKDB_BENCHMARK(DSQ038, "[tpcds-sf1]")
181TPCDS_QUERY_BODY(38);
182FINISH_BENCHMARK(DSQ038);
183
184DUCKDB_BENCHMARK(DSQ039, "[tpcds-sf1]")
185TPCDS_QUERY_BODY(39);
186FINISH_BENCHMARK(DSQ039);
187
188DUCKDB_BENCHMARK(DSQ040, "[tpcds-sf1]")
189TPCDS_QUERY_BODY(40);
190FINISH_BENCHMARK(DSQ040);
191
192DUCKDB_BENCHMARK(DSQ041, "[tpcds-sf1]")
193TPCDS_QUERY_BODY(41);
194FINISH_BENCHMARK(DSQ041);
195
196DUCKDB_BENCHMARK(DSQ042, "[tpcds-sf1]")
197TPCDS_QUERY_BODY(42);
198FINISH_BENCHMARK(DSQ042);
199
200DUCKDB_BENCHMARK(DSQ043, "[tpcds-sf1]")
201TPCDS_QUERY_BODY(43);
202FINISH_BENCHMARK(DSQ043);
203
204DUCKDB_BENCHMARK(DSQ044, "[tpcds-sf1]")
205TPCDS_QUERY_BODY(44);
206FINISH_BENCHMARK(DSQ044);
207
208DUCKDB_BENCHMARK(DSQ045, "[tpcds-sf1]")
209TPCDS_QUERY_BODY(45);
210FINISH_BENCHMARK(DSQ045);
211
212DUCKDB_BENCHMARK(DSQ046, "[tpcds-sf1]")
213TPCDS_QUERY_BODY(46);
214FINISH_BENCHMARK(DSQ046);
215
216DUCKDB_BENCHMARK(DSQ047, "[tpcds-sf1]")
217TPCDS_QUERY_BODY(47);
218FINISH_BENCHMARK(DSQ047);
219
220DUCKDB_BENCHMARK(DSQ048, "[tpcds-sf1]")
221TPCDS_QUERY_BODY(48);
222FINISH_BENCHMARK(DSQ048);
223
224DUCKDB_BENCHMARK(DSQ049, "[tpcds-sf1]")
225TPCDS_QUERY_BODY(49);
226FINISH_BENCHMARK(DSQ049);
227
228DUCKDB_BENCHMARK(DSQ050, "[tpcds-sf1]")
229TPCDS_QUERY_BODY(50);
230FINISH_BENCHMARK(DSQ050);
231
232DUCKDB_BENCHMARK(DSQ051, "[tpcds-sf1]")
233TPCDS_QUERY_BODY(51);
234FINISH_BENCHMARK(DSQ051);
235
236DUCKDB_BENCHMARK(DSQ052, "[tpcds-sf1]")
237TPCDS_QUERY_BODY(52);
238FINISH_BENCHMARK(DSQ052);
239
240DUCKDB_BENCHMARK(DSQ053, "[tpcds-sf1]")
241TPCDS_QUERY_BODY(53);
242FINISH_BENCHMARK(DSQ053);
243
244DUCKDB_BENCHMARK(DSQ054, "[tpcds-sf1]")
245TPCDS_QUERY_BODY(54);
246FINISH_BENCHMARK(DSQ054);
247
248DUCKDB_BENCHMARK(DSQ055, "[tpcds-sf1]")
249TPCDS_QUERY_BODY(55);
250FINISH_BENCHMARK(DSQ055);
251
252DUCKDB_BENCHMARK(DSQ056, "[tpcds-sf1]")
253TPCDS_QUERY_BODY(56);
254FINISH_BENCHMARK(DSQ056);
255
256DUCKDB_BENCHMARK(DSQ057, "[tpcds-sf1]")
257TPCDS_QUERY_BODY(57);
258FINISH_BENCHMARK(DSQ057);
259
260DUCKDB_BENCHMARK(DSQ058, "[tpcds-sf1]")
261TPCDS_QUERY_BODY(58);
262FINISH_BENCHMARK(DSQ058);
263
264DUCKDB_BENCHMARK(DSQ059, "[tpcds-sf1]")
265TPCDS_QUERY_BODY(59);
266FINISH_BENCHMARK(DSQ059);
267
268DUCKDB_BENCHMARK(DSQ060, "[tpcds-sf1]")
269TPCDS_QUERY_BODY(60);
270FINISH_BENCHMARK(DSQ060);
271
272DUCKDB_BENCHMARK(DSQ061, "[tpcds-sf1]")
273TPCDS_QUERY_BODY(61);
274FINISH_BENCHMARK(DSQ061);
275
276DUCKDB_BENCHMARK(DSQ062, "[tpcds-sf1]")
277TPCDS_QUERY_BODY(62);
278FINISH_BENCHMARK(DSQ062);
279
280DUCKDB_BENCHMARK(DSQ063, "[tpcds-sf1]")
281TPCDS_QUERY_BODY(63);
282FINISH_BENCHMARK(DSQ063);
283
284DUCKDB_BENCHMARK(DSQ064, "[tpcds-sf1]")
285TPCDS_QUERY_BODY(64);
286FINISH_BENCHMARK(DSQ064);
287
288DUCKDB_BENCHMARK(DSQ065, "[tpcds-sf1]")
289TPCDS_QUERY_BODY(65);
290FINISH_BENCHMARK(DSQ065);
291
292DUCKDB_BENCHMARK(DSQ066, "[tpcds-sf1]")
293TPCDS_QUERY_BODY(66);
294FINISH_BENCHMARK(DSQ066);
295
296DUCKDB_BENCHMARK(DSQ067, "[tpcds-sf1]")
297TPCDS_QUERY_BODY(67);
298FINISH_BENCHMARK(DSQ067);
299
300DUCKDB_BENCHMARK(DSQ068, "[tpcds-sf1]")
301TPCDS_QUERY_BODY(68);
302FINISH_BENCHMARK(DSQ068);
303
304DUCKDB_BENCHMARK(DSQ069, "[tpcds-sf1]")
305TPCDS_QUERY_BODY(69);
306FINISH_BENCHMARK(DSQ069);
307
308DUCKDB_BENCHMARK(DSQ070, "[tpcds-sf1]")
309TPCDS_QUERY_BODY(70);
310FINISH_BENCHMARK(DSQ070);
311
312DUCKDB_BENCHMARK(DSQ071, "[tpcds-sf1]")
313TPCDS_QUERY_BODY(71);
314FINISH_BENCHMARK(DSQ071);
315
316DUCKDB_BENCHMARK(DSQ072, "[tpcds-sf1]")
317TPCDS_QUERY_BODY(72);
318FINISH_BENCHMARK(DSQ072);
319
320DUCKDB_BENCHMARK(DSQ073, "[tpcds-sf1]")
321TPCDS_QUERY_BODY(73);
322FINISH_BENCHMARK(DSQ073);
323
324DUCKDB_BENCHMARK(DSQ074, "[tpcds-sf1]")
325TPCDS_QUERY_BODY(74);
326FINISH_BENCHMARK(DSQ074);
327
328DUCKDB_BENCHMARK(DSQ075, "[tpcds-sf1]")
329TPCDS_QUERY_BODY(75);
330FINISH_BENCHMARK(DSQ075);
331
332DUCKDB_BENCHMARK(DSQ076, "[tpcds-sf1]")
333TPCDS_QUERY_BODY(76);
334FINISH_BENCHMARK(DSQ076);
335
336DUCKDB_BENCHMARK(DSQ077, "[tpcds-sf1]")
337TPCDS_QUERY_BODY(77);
338FINISH_BENCHMARK(DSQ077);
339
340DUCKDB_BENCHMARK(DSQ078, "[tpcds-sf1]")
341TPCDS_QUERY_BODY(78);
342FINISH_BENCHMARK(DSQ078);
343
344DUCKDB_BENCHMARK(DSQ079, "[tpcds-sf1]")
345TPCDS_QUERY_BODY(79);
346FINISH_BENCHMARK(DSQ079);
347
348DUCKDB_BENCHMARK(DSQ080, "[tpcds-sf1]")
349TPCDS_QUERY_BODY(80);
350FINISH_BENCHMARK(DSQ080);
351
352DUCKDB_BENCHMARK(DSQ081, "[tpcds-sf1]")
353TPCDS_QUERY_BODY(81);
354FINISH_BENCHMARK(DSQ081);
355
356DUCKDB_BENCHMARK(DSQ082, "[tpcds-sf1]")
357TPCDS_QUERY_BODY(82);
358FINISH_BENCHMARK(DSQ082);
359
360DUCKDB_BENCHMARK(DSQ083, "[tpcds-sf1]")
361TPCDS_QUERY_BODY(83);
362FINISH_BENCHMARK(DSQ083);
363
364DUCKDB_BENCHMARK(DSQ084, "[tpcds-sf1]")
365TPCDS_QUERY_BODY(84);
366FINISH_BENCHMARK(DSQ084);
367
368DUCKDB_BENCHMARK(DSQ085, "[tpcds-sf1]")
369TPCDS_QUERY_BODY(85);
370FINISH_BENCHMARK(DSQ085);
371
372DUCKDB_BENCHMARK(DSQ086, "[tpcds-sf1]")
373TPCDS_QUERY_BODY(86);
374FINISH_BENCHMARK(DSQ086);
375
376DUCKDB_BENCHMARK(DSQ087, "[tpcds-sf1]")
377TPCDS_QUERY_BODY(87);
378FINISH_BENCHMARK(DSQ087);
379
380DUCKDB_BENCHMARK(DSQ088, "[tpcds-sf1]")
381TPCDS_QUERY_BODY(88);
382FINISH_BENCHMARK(DSQ088);
383
384DUCKDB_BENCHMARK(DSQ089, "[tpcds-sf1]")
385TPCDS_QUERY_BODY(89);
386FINISH_BENCHMARK(DSQ089);
387
388DUCKDB_BENCHMARK(DSQ090, "[tpcds-sf1]")
389TPCDS_QUERY_BODY(90);
390FINISH_BENCHMARK(DSQ090);
391
392DUCKDB_BENCHMARK(DSQ091, "[tpcds-sf1]")
393TPCDS_QUERY_BODY(91);
394FINISH_BENCHMARK(DSQ091);
395
396DUCKDB_BENCHMARK(DSQ092, "[tpcds-sf1]")
397TPCDS_QUERY_BODY(92);
398FINISH_BENCHMARK(DSQ092);
399
400DUCKDB_BENCHMARK(DSQ093, "[tpcds-sf1]")
401TPCDS_QUERY_BODY(93);
402FINISH_BENCHMARK(DSQ093);
403
404DUCKDB_BENCHMARK(DSQ094, "[tpcds-sf1]")
405TPCDS_QUERY_BODY(94);
406FINISH_BENCHMARK(DSQ094);
407
408DUCKDB_BENCHMARK(DSQ095, "[tpcds-sf1]")
409TPCDS_QUERY_BODY(95);
410FINISH_BENCHMARK(DSQ095);
411
412DUCKDB_BENCHMARK(DSQ096, "[tpcds-sf1]")
413TPCDS_QUERY_BODY(96);
414FINISH_BENCHMARK(DSQ096);
415
416DUCKDB_BENCHMARK(DSQ097, "[tpcds-sf1]")
417TPCDS_QUERY_BODY(97);
418FINISH_BENCHMARK(DSQ097);
419
420DUCKDB_BENCHMARK(DSQ098, "[tpcds-sf1]")
421TPCDS_QUERY_BODY(98);
422FINISH_BENCHMARK(DSQ098);
423
424DUCKDB_BENCHMARK(DSQ099, "[tpcds-sf1]")
425TPCDS_QUERY_BODY(99);
426FINISH_BENCHMARK(DSQ099);
427
428DUCKDB_BENCHMARK(DSQ100, "[tpcds-sf1]")
429TPCDS_QUERY_BODY(100);
430FINISH_BENCHMARK(DSQ100);
431
432DUCKDB_BENCHMARK(DSQ101, "[tpcds-sf1]")
433TPCDS_QUERY_BODY(101);
434FINISH_BENCHMARK(DSQ101);
435
436DUCKDB_BENCHMARK(DSQ102, "[tpcds-sf1]")
437TPCDS_QUERY_BODY(102);
438FINISH_BENCHMARK(DSQ102);
439
440DUCKDB_BENCHMARK(DSQ103, "[tpcds-sf1]")
441TPCDS_QUERY_BODY(103);
442FINISH_BENCHMARK(DSQ103);
443