Have an empty MySQL database, how to fill a lot of random data into MySQL to test the statement performance?
Everyone brainstorming, can skip PHP directly with SQL to achieve better.
Target 500,000--1 million this level around.
Reply content:
Have an empty MySQL database, how to fill a lot of random data into MySQL to test the statement performance?
Everyone brainstorming, can skip PHP directly with SQL to achieve better.
Target 500,000--1 million this level around.
Try Generatedata This is open source, you can build a site locally, generate the data you want.
There are many other similar, refer to this list:
Http://databene.org/databene-benerator/similar-products.html
PHP generates a SQL file import ~
INSERT INTO `table` ( `field1`, `field2` ) VALUES( 1,1 ),( 2,2 )....( 5000,5000 );
Accidentally found a pure SQL method, Quack!
BENCHMARK (loop_count,expression)
Try the stored procedure much faster than PHP.
declare i int default 0;
While I < 100000000 do
Insert into users (value) values (RAND ());
Set i = i + 1;
End while;
A SQL is not the right thing to do.
I've asked a professional DBA before.