You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
Don't hardocde table name
This commit is contained in:
committed by
Leonid Fedorov
parent
8290374f5b
commit
a88e335cb7
@ -16,6 +16,7 @@ Available options:
|
||||
-h, --help Print this help and exit
|
||||
-d, --data Data for table that will be given to cpimport; if no name provided it will be generated.
|
||||
-s, --size Size of the dataset to generate
|
||||
-t, --table Name of the table
|
||||
EOF
|
||||
exit
|
||||
}
|
||||
@ -30,6 +31,13 @@ cleanup() {
|
||||
then
|
||||
sudo rm $DATA
|
||||
fi
|
||||
sudo rm "${BRANCH}_bench.txt"
|
||||
sudo rm "develop_bench.txt"
|
||||
sysbench $SCRIPT --mysql-socket=/run/mysqld/mysqld.sock \
|
||||
--db-driver=mysql \
|
||||
--mysql-db=test \
|
||||
cleanup
|
||||
unset TABLE
|
||||
}
|
||||
|
||||
die() {
|
||||
@ -56,6 +64,7 @@ parse_params() {
|
||||
|
||||
SCRIPT="$2"
|
||||
RANGE=1000000
|
||||
TABLE="t1"
|
||||
|
||||
while :; do
|
||||
case "${1-}" in
|
||||
@ -65,6 +74,9 @@ parse_params() {
|
||||
-s | --size) RANGE="${2-}"
|
||||
shift
|
||||
;;
|
||||
-t | --table) TABLE="${2-}"
|
||||
shift
|
||||
;;
|
||||
-?*) die "Unknown option: $1" ;;
|
||||
*) break ;;
|
||||
esac
|
||||
@ -75,6 +87,7 @@ parse_params() {
|
||||
}
|
||||
|
||||
parse_params "$@"
|
||||
export TABLE
|
||||
cd $MDB_SOURCE_PATH/columnstore/columnstore/benchmarks
|
||||
seq 1 $RANGE > "$DATA"
|
||||
|
||||
@ -113,9 +126,4 @@ sysbench $SCRIPT \
|
||||
--mysql-db=test \
|
||||
--time=30 run | tail -n +12 > develop_bench.txt
|
||||
|
||||
sysbench $SCRIPT --mysql-socket=/run/mysqld/mysqld.sock \
|
||||
--db-driver=mysql \
|
||||
--mysql-db=test \
|
||||
cleanup
|
||||
|
||||
python3 parse_bench.py "$BRANCH" "${BRANCH}_bench.txt" "develop_bench.txt"
|
||||
|
@ -2,12 +2,12 @@ require("bench_report")
|
||||
|
||||
function prepare ()
|
||||
local i
|
||||
print("creating table test.t1 ...")
|
||||
db_query("create table t1 (c1 int)engine=columnstore")
|
||||
print("creating table...")
|
||||
db_query("create table if not exists " .. os.getenv("TABLE") .. " (c1 int)engine=columnstore")
|
||||
end
|
||||
|
||||
function cleanup()
|
||||
db_query("drop table t1")
|
||||
db_query("drop table if exists" .. os.getenv("TABLE") ..)
|
||||
end
|
||||
|
||||
function help()
|
||||
@ -22,7 +22,7 @@ function thread_done(thread_id)
|
||||
end
|
||||
|
||||
function event(thread_id)
|
||||
db_query("select c1 from t1 where c1 = 5 or c1 = 10")
|
||||
db_query("select c1 from " .. os.getenv("TABLE") .. " where c1 = 5 or c1 = 10")
|
||||
end
|
||||
|
||||
sysbench.hooks.report_intermediate = sysbench.report_json
|
||||
|
Reference in New Issue
Block a user