revision-id: 7466fe9f82cebb0f64b66dab0b96b84e4ba0a9f1 () parent(s): 0a239bae9791c327ecca1e25d9a082466956bc38 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2020-03-07 22:52:46 +0300 message: A test using mysqlslap --- 03-run-sort-int-mysqlslap.sh | 33 ++++++++++++++++++++++++ filesort-bench1/02-make-clean-sort-int-tables.sh | 11 ++++++++ filesort-bench1/02-make-fill-sort-int-tables.sh | 21 +++++++++++++++ setup-server/setup-mariadb-current.sh | 3 ++- 4 files changed, 67 insertions(+), 1 deletion(-) diff --git a/03-run-sort-int-mysqlslap.sh b/03-run-sort-int-mysqlslap.sh new file mode 100644 index 0000000..65d1b1f --- /dev/null +++ b/03-run-sort-int-mysqlslap.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -e + +RES='result-02-sort-int-mysqlslap' + +mkdir $RES + +# Generate the scripts +bash filesort-bench1/02-make-fill-sort-int-tables.sh > $RES/fill-sort-int-tables.sql +bash filesort-bench1/02-make-clean-sort-int-tables.sh > $RES/clean-sort-int-tables.sql + +for SERVER in mariadb-10.5 mariadb-10.5-mdev6915-ext ; do + +bash prepare-server.sh -m $SERVER +source $SERVER-vars.sh + +$MYSQL $MYSQL_ARGS test < $RES/fill-sort-int-tables.sql | tee $RES/fill-log-$SERVER.txt + +for size in 100000 500000 1000000 2000000 4000000 ; do + +$MYSQLSLAP $MYSQL_ARGS \ + --create-schema=test --no-drop \ + --query="select a, b from t_int_$size order by a limit 100" \ + --concurrency=30 --iterations=400 | tee -a $RES/result-$SERVER.txt + +done + +$MYSQL $MYSQL_ARGS test < $RES/clean-sort-int-tables.sql | tee $RES/clean-log-$SERVER.txt + +done +exit 0; + diff --git a/filesort-bench1/02-make-clean-sort-int-tables.sh b/filesort-bench1/02-make-clean-sort-int-tables.sh new file mode 100644 index 0000000..9260bec --- /dev/null +++ b/filesort-bench1/02-make-clean-sort-int-tables.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +# Drop the tables + +for size in 100000 500000 1000000 2000000 4000000 8000000 16000000 32000000; do + +cat <<END +drop table if exists t_int_$size; +END + +done diff --git a/filesort-bench1/02-make-fill-sort-int-tables.sh b/filesort-bench1/02-make-fill-sort-int-tables.sh new file mode 100644 index 0000000..99800af --- /dev/null +++ b/filesort-bench1/02-make-fill-sort-int-tables.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Just create the tables + +for size in 100000 500000 1000000 2000000 4000000 8000000 16000000 32000000; do + +cat <<END +drop table if exists t_int_$size; +create table t_int_$size ( + a int, b int +) engine=myisam; + +insert into t_int_$size +select + floor(rand() * 25), 1234 +from seq_1_to_$size; + +analyze table t_int_$size; +END + +done diff --git a/setup-server/setup-mariadb-current.sh b/setup-server/setup-mariadb-current.sh index 12b8b55..9f1b3bb 100755 --- a/setup-server/setup-mariadb-current.sh +++ b/setup-server/setup-mariadb-current.sh @@ -81,7 +81,8 @@ innodb_buffer_pool_size=8G EOF cat > mysql-vars.sh <<EOF -MYSQL="./mariadb-$BRANCH/client/mysql" +MYSQL="`pwd`/mariadb-$BRANCH/client/mysql" +MYSQLSLAP="`pwd`/mariadb-$BRANCH/client/mysqlslap" MYSQL_SOCKET="--socket=$SOCKETNAME" MYSQL_USER="-uroot" MYSQL_ARGS="\$MYSQL_USER \$MYSQL_SOCKET"