I have an empty MYSQL database. How do I enter a large amount of random data into MYSQL to test the statement performance? You can skip PHP and directly use SQL to achieve better performance. target 0.5 million -- about 1 million. I have an empty MYSQL database. How do I enter a large amount of random data into MYSQL to test the statement performance?
You can skip PHP and directly use SQL to achieve better performance.
Target0.5 million -- 1 millionAbout this level.
Reply content:
I have an empty MYSQL database. How do I enter a large amount of random data into MYSQL to test the statement performance?
You can skip PHP and directly use SQL to achieve better performance.
Target0.5 million -- 1 millionAbout this level.
Try generatedata, which is open-source. You can build a local site to generate the desired data.
There are many other similar items. Refer to this list:
Http://databene.org/databene-benerator/similar-products.html
Php generates an SQL file for import ~
INSERT INTO `table` ( `field1`, `field2` ) VALUES( 1,1 ),( 2,2 )....( 5000,5000 );
I accidentally discovered a pure SQL method!
BENCHMARK (loop_count, expression)
The stored procedure is much faster than PHP.
Declare I int default 0;
While I & lt; 100000000 do
Insert into users (value) values (RAND ());
Set I = I + 1;
End while;
This is not the case for an SQL statement.
I have asked professional DBAs before.