-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I kicked this off last night before bed. It ran much quicker than
I thought, due to that 27 hour estimate.
Total time: 23 minutes 29 seconds :)
I committed every 2000 table commits. It could probably be made
to go slightly faster, as this was an out-of-the-box Postgres database,
with no postgresql.conf tweaking. I simply piped a text file into
psql for the testing, from the outout of a quick perl script:
my $max = 1_000_000;
my $check = 2_000;
print "BEGIN;\n";
for my $num (1..$max) {
print "CREATE TABLE foo$num (a smallint);\n";
$num%$check or print "COMMIT;\nBEGIN;\n";
}
print "COMMIT;\n";
And the proof:
greg=# select count(*) from pg_class where relkind='r' and relname ~ 'foo'
count
- ---------
1000000
Maybe I'll see just how far PG *can* go next. Time to make a PlanetPG post,
at any rate.
- --
Greg Sabino Mullane greg@turnstep.com
PGP Key: 0x14964AC8 200603090720
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----
iD8DBQFEEB2yvJuQZxSWSsgRAvUbAKCzO80prZ4DX4l3iT0Dh+Re5M4TpACfW95z
y4cdkQjw2ubAP4btMwSw5iw=
=Ginx
-----END PGP SIGNATURE-----