-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_insert_benchmarks.bash
43 lines (31 loc) · 1 KB
/
run_insert_benchmarks.bash
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
#!/bin/bash
set -e
source .env
methods=("pandas" "psycopg3" "sqlalchemy")
table_types=("regular" "hyper")
runs=10
wait_for_db_to_be_ready() {
while ! docker exec -it -u postgres "$CONTAINER_NAME" pg_isready -h "$POSTGRES_HOST" -U "$POSTGRES_USER"; do
sleep 2
done
}
for (( i=1; i<=$runs; i++ )); do
for method in "${methods[@]}"; do
for table_type in "${table_types[@]}"; do
set -x
docker-compose up --detach
wait_for_db_to_be_ready
poetry run python create_table.py \
--drop-table \
--table-type $table_type
poetry run python insert_data.py \
--method $method \
--table-type $table_type \
--num-rows 20000 \
--benchmarks-file "benchmarks_insert.csv"
docker-compose down
{ set +x; } 2>/dev/null
done
done
done
poetry run python plot_insert_benchmarks.py --benchmarks-file "benchmarks_insert.csv"