Description:
According to the documentation, --query=query and --query=filename should work the same. But it doesn't.
For some reason, the queries in a specified file are executed twice ( Average number of queries per client: 2), in contrast to just once when putting the query into the command line.
How to repeat:
kai-voigts-computer:~/MySQL/Benchmarks k$ time mysqlslap --user=root --password=root --concurrency=5 --iterations=5 --create-schema=world --query=sortbuffer/queries.sql
Benchmark
Average number of seconds to run all queries: 17.740 seconds
Minimum number of seconds to run all queries: 17.076 seconds
Maximum number of seconds to run all queries: 19.093 seconds
Number of clients running queries: 5
Average number of queries per client: 2
real 1m28.712s
user 0m0.005s
sys 0m0.012s
kai-voigts-computer:~/MySQL/Benchmarks k$ cat sortbuffer/queries.sql
SELECT City.Name FROM City JOIN Country ORDER BY RAND() LIMIT 1;
kai-voigts-computer:~/MySQL/Benchmarks k$ time mysqlslap --user=root --password=root --concurrency=5 --iterations=5 --create-schema=world --query="SELECT City.Name FROM City JOIN Country ORDER BY RAND() LIMIT 1;"
Benchmark
Average number of seconds to run all queries: 8.973 seconds
Minimum number of seconds to run all queries: 8.412 seconds
Maximum number of seconds to run all queries: 9.336 seconds
Number of clients running queries: 5
Average number of queries per client: 1
real 0m44.878s
user 0m0.004s
sys 0m0.011s