Tell me more ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I need to insert 25 000 or 50 000 test rows for make some performance tests in several tables in my DB. I'm using PHP but the script takes to long to run so in shared hosting is a pain! I'm asking if I can do this at DB level. I think that http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html could be the solution but the logic at programation level is a bit complicated so didn't know for example how to RANDOM words for generate unique fields name like username for example

Thanks in advance

share|improve this question
No table definition or logic in the question? It's very easy to write a small bit of code (PHP if you like) to write INSERT statements with random values to a file. – Phil Aug 27 '12 at 14:25
@Phil I wrote by now in PHP but it's a bit slowly when insert 50 000 rows due to mysql_query calls for that reason I'm looking a way to do this in DB – ReynierPM Aug 27 '12 at 15:46
This post has some good tips: stackoverflow.com/questions/3060169/… – wes.stueve Aug 27 '12 at 16:04
@ReynierPM No, I meant write a PHP script that puts the INSERT statements in a flat file, which you can then run into the DB using the command-line. – Phil Aug 27 '12 at 16:28
@Phil thanks didn't think on that before I'll give a try and wes.stueve thanks to you too I'll test your suggestion too – ReynierPM Aug 27 '12 at 18:49

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.