Be mindful of maintaining integrity in your data. If you decide to drop the indices for importing (which does increase the speed) then the responsibility of integrity falls to you the importer.
Turning Autocommit off is a great idea, which also speeds things up. However , unless you are certain your data is clean you may well want to turn autocommit off but commit on every valid transaction and rollback on invalid ones like so
eval{$sth->execute("BLAH")}
if($@)
{
$dbh->rollback();
}
else
{
$dbh->commit();
}
but with bulk insert I don't know if that's so much an option... so in other words you've gotta make sure that data is clean at some point in the process. your data importation method helps determine when this cleaning takes place.
MS-SQL does have a BULK INSERT command that I'm aware of, check your docs, they are actually pretty good
Best of luck on your problem,
|