Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql table size calculation #93

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion infobright/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ time sudo docker run -it --rm --volume $(pwd):/workdir --network host mysql:5 my

# 38m37.466s

sudo docker exec mysql_ib du -bcs /mnt/mysql_data/ /usr/local/infobright-4.0.7-x86_64/cache
# Calculate the table size
sudo docker run -it --rm --network host mysql:5 mysql --host 127.0.0.1 --port 5029 --user=root --password=mypass -e "SELECT table_name AS 'Table', \
round((data_length + index_length), 2) 'Size in Bytes' \
FROM information_schema.TABLES WHERE table_schema = 'test' AND table_name = 'hits';"

# 13 760 341 294

Expand Down
5 changes: 4 additions & 1 deletion mariadb/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ time split -l 10000 --filter="sudo mariadb test -e \"SET sql_log_bin = 0; LOAD D

./run.sh 2>&1 | tee log.txt

sudo du -bcs /var/lib/mysql
# Calculate the table size
sudo mariadb -e "SELECT table_name AS 'Table', \
round((data_length + index_length), 2) 'Size in Bytes' \
FROM information_schema.TABLES WHERE table_schema = 'test' AND table_name = 'hits';"

cat log.txt |
grep -P 'rows? in set|Empty set|^ERROR' |
Expand Down
4 changes: 3 additions & 1 deletion mysql-myisam/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ time sudo mysql test -e "LOAD DATA LOCAL INFILE 'hits.tsv' INTO TABLE hits"

./run.sh 2>&1 | tee log.txt

sudo du -bcs /var/lib/mysql
sudo mysql -e "SELECT table_name AS 'Table', \
round((data_length + index_length), 2) 'Size in Bytes' \
FROM information_schema.TABLES WHERE table_schema = 'test' AND table_name = 'hits';"

cat log.txt |
grep -P 'rows? in set|Empty set|^ERROR' |
Expand Down
4 changes: 3 additions & 1 deletion mysql/benchmark.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ time sudo mysql test -e "LOAD DATA LOCAL INFILE 'hits.tsv' INTO TABLE hits"

./run.sh 2>&1 | tee log.txt

sudo du -bcs /var/lib/mysql
sudo mysql -e "SELECT table_name AS 'Table', \
round((data_length + index_length), 2) 'Size in Bytes' \
FROM information_schema.TABLES WHERE table_schema = 'test' AND table_name = 'hits';"

cat log.txt |
grep -P 'rows? in set|Empty set|^ERROR' |
Expand Down