Of course it's silly, anyone considering anything like this
should seriously look at their design! But someone else blogged about this, so that got me curious. He ran
on Win2003 with NTFS and created InnoDB tables.
I happened to have RHEL4 box (P4) floating around, so I wrote a
little PHP script:
$db = mysql_connect(':/tmp/mysql.sock','user','pwd')
or die(mysql_errno().': '.mysql_error());
mysql_select_db('maxtables',$db)
or die(mysql_errno().': '.mysql_error());
for ($i = 1; $i <= 1000000; $i++) {
print "\r{$i}\t";
$query = "CREATE TABLE t{$i} (i TINYINT) ENGINE=MyISAM";
mysql_query($query)
or die(mysql_errno().': '.mysql_error());
}
mysql_close($db);
It took 2 1/2 hours to complete on a 4.1 server (there's a 5.0 on
the box but it's handling other stuff). Not too shabby and no
problems …
[Read more]