Created
July 30, 2010 11:13
-
-
Save PatrickLef/500329 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'mysql' | |
db = Mysql.new("localhost", "root", "", "test") | |
words = %w{patrick johan peter niklas} | |
500_000.times do | |
db.query("INSERT INTO innodb SET varcharen='#{words[rand(words.size)]}', inten=#{rand(words.size)}, enumen='#{words[rand(words.size)]}'") | |
db.query("INSERT INTO innodb_index SET varcharen='#{words[rand(words.size)]}', inten=#{rand(words.size)}, enumen='#{words[rand(words.size)]}'") | |
db.query("INSERT INTO myisam SET varcharen='#{words[rand(words.size)]}', inten=#{rand(words.size)}, enumen='#{words[rand(words.size)]}'") | |
db.query("INSERT INTO myisam_index SET varcharen='#{words[rand(words.size)]}', inten=#{rand(words.size)}, enumen='#{words[rand(words.size)]}'") | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment