Mysql uses stored procedure manufacturing test data bitsCN.com
Mysql creates test data using stored procedures
[SQL]
DELIMITER $
Drop procedure if exists message_insert_procedure;
Create procedure 'test'. 'message _ insert_procedure '(loop_times INT)
BEGIN
DECLARE var int default 0;
WHILE var
SET var = var + 1;
Insert into test. message (msg_id, content, type, creator_id, create_time)
VALUES. Undo the tornado and strip it out. Put a pin into it and bite the slaves. '), Now ());
End while;
END
The above code is as follows:
Note: test is my database, and message is my table. In addition, I am in a bad mood today.
Use the following command to call the SDK:
[Html]
Use test;
Delete from message;
Call message_insert_procedure (10000000 );
Delete from message in the middle. if you use software such as workbench, this is an error. in the SQL queries option of workbench performance, remove "Safe Updates" under the General subitem, and reconnect it.
Data Testing: mysql in Ubuntu 12.10, with 548 million data records and seconds.
BitsCN.com