ClickHouse/benchmark/compatible/postgresql/benchmark.sh

24 lines
734 B
Bash
Raw Normal View History

2022-06-26 04:00:07 +00:00
#!/bin/bash
sudo apt-get update
2022-06-26 22:24:11 +00:00
sudo apt-get install -y postgresql-common
sudo apt-get install -y postgresql-14
2022-06-26 04:00:07 +00:00
2022-06-26 21:04:19 +00:00
wget --continue 'https://datasets.clickhouse.com/hits_compatible/hits.tsv.gz'
2022-06-26 04:00:07 +00:00
gzip -d hits.tsv.gz
chmod 777 ~ hits.tsv
sudo -u postgres psql -t -c 'CREATE DATABASE test'
sudo -u postgres psql test -t < create.sql
sudo -u postgres psql test -t -c '\timing' -c "\\copy hits FROM 'hits.tsv'"
# COPY 99997497
# Time: 2341543.463 ms (39:01.543)
2022-06-26 05:31:49 +00:00
./run.sh 2>&1 | tee log.txt
2022-06-26 18:14:43 +00:00
sudo du -bcs /var/lib/postgresql/14/main/
cat log.txt | grep -oP 'Time: \d+\.\d+ ms' | sed -r -e 's/Time: ([0-9]+\.[0-9]+) ms/\1/' |
awk '{ if (i % 3 == 0) { printf "[" }; printf $1; if (i % 3 != 2) { printf "," } else { print "]," }; ++i; }'