-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
69 lines (53 loc) · 1.65 KB
/
Makefile
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
61
62
63
64
65
66
67
68
SCALE_FACTOR ?= 1
RUNN ?= 3
MEM_SIZE ?= $(shell echo 5*1024^3 | bc)
TPCHD = tpch-dbgen
DBGEN = $(TPCHD)/dbgen
QGEN = $(TPCHD)/qgen
TABLES = customer lineitem nation orders partsupp part region supplier
TABLE_FILES = $(foreach table, $(TABLES), $(TPCHD)/$(table).tbl)
TARANTOOL ?= tarantool
SQLITE_DB = TPC-H.db
TNT_DB = 00000000000000000000.snap
NUMAOPTS ?=
all: | bench-sqlite bench-tnt report
# TPC-H binaries and seed data
$(TABLE_FILES): $(DBGEN)
cd $(TPCHD) && ./dbgen -f -s $(SCALE_FACTOR)
chmod +r $(TABLE_FILES)
$(DBGEN) $(QGEN): $(TPCHD)/Makefile
$(MAKE) -C $(TPCHD) all
# **optional step** regenerate TPC-H queries
# NB! you don't want to run it everytime:
# queries were manually changed to make
# them SQLite compatible
gen-queries: $(QGEN)
@mkdir -p queries/ > /dev/null
./gen_queries.sh
# target for populate sqlite database
create_SQL_db : $(SQLITE_DB)
# SQLite: populate databases
$(SQLITE_DB): | $(TABLE_FILES) sqlite-ddl.sql
./create_db.sh $(TABLES)
# target for populate Tarantool database
create_TNT_db : $(TNT_DB)
# Tarantool: populate database
$(TNT_DB): | $(TABLE_FILES)
$(TARANTOOL) create_table.lua -m $(MEM_SIZE)
# run benchmarks
bench-sqlite: create_SQL_db
$(NUMAOPTS) ./bench_queries.sh 2>&1 | tee bench-sqlite.log
bench-tnt: create_TNT_db
$(NUMAOPTS) $(TARANTOOL) execute_query.lua \
-m $(MEM_SIZE) -n $(RUNN) 2>&1 | tee bench-tnt.log
report:
perl ./report.pl bench-sqlite.log > bench-sqlite.csv
grep '^Q' bench-tnt.log > bench-tnt.csv
# clean everything
clean: clean-tpch clean-sqlite clean-tnt
clean-tpch:
$(MAKE) -C $(TPCHD) clean
clean-sqlite: clean-tpch
rm -rf $(SQLITE_DB) $(TABLE_FILES)
clean-tnt:
rm -f *.xlog *.snap