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.

Answers


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.

Download: http://code.google.com/p/tungsten-toolbox/downloads/list

Docs: http://code.google.com/p/tungsten-toolbox/wiki/Large_Data_generator


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 generatedata.com 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 databasetestdata.com. It doesn't seem as customisable generatedata.com, 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.