How to generate random data for testing database performance?

I have created a test table in MySQL and would like to insert 10 million rows with randomly generated data. How to do this random generation process? Is there any predefined method in MySQL or is there any quick query we can construct to do this job?

Thank you for any help.


On MySQL forge: RandomDataGenerator:

The Random Data Generator allows the creation of tables of arbitary size containing an arbitary combination of columns, filled with random data.

You might also like the Large Data Generator (ldg) script from Tungsten's toolbox, useful for larger datasets.



This one is as easy as:

call procedurename('DATABASE','TABLE',1000,'');  

will fill 1000 random rows.

Here is the stored procedure to generate random test data.

Try which seems very customisable. You can also create an account on the website to store your configuration by donating or fork the project on GitHub and install it locally.

An alternative is It doesn't seem as customisable, but does a pretty good job. You can also store and reuse your fields layouts (aka recipes).

I would recommend downloading the data as CSV and using MySQL's LOAD DATA INFILE to import the data into your database.

Need Your Help

Hibernate Full Text Search

hibernate search full-text-search hibernate-search

I was just created a hibernate full text search using hibernate-search-4.1.1.Final.jar and all runtime dependencies.