1

I'm trying to benchmark Read/Write speed in MySQL 5.5. Currently I have a stored procedure that insert rows with random numbers to a table and I'm measuring time of execution before and after configuration changes.

Here's my procedure:

CREATE DEFINER=`root`@`localhost` PROCEDURE `InsertRand`(IN nor INT, in minr int, in maxr int)
begin
 declare i int;
 declare lastid int;
 set i =1;
 start transaction;
 while i <= nor do
 insert into tbltest(Value) values (minr + CEIL(rand() * (maxr-minr)));
 set lastid = (select MAX(id) from tbltest);
 set i = i +1;
 end while;
 commit;
 end

Do you know any good way to benchmark this ? Maybe my procedure needs some improvement?

RolandoMySQLDBA
185k34 gold badges327 silver badges541 bronze badges
asked Jun 23, 2015 at 14:22

1 Answer 1

0

You should use MySQL's BENCHMARK() function

Here are my posts on how to use it

BTW if you do configuartion changes, you should restart mysqld immediately after the configuration changes are in place. Then, run your I/O tests.

answered Jun 23, 2015 at 15:55
1
  • Very precise and useful answer :) exactly what i needed :) thanks a lot! Commented Jun 23, 2015 at 17:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.