in reply to DBD::SQLite bulk insert woes

When you use SQLite, you M*U*S*T use transactions. If you don't, then SQLite will verify that every disk write actually succeeded before returning. This slows everything to a crawl even on the fastest machines.

Replies are listed 'Best First'.
Re^2: DBD::SQLite bulk insert woes
by Anonymous Monk on Jun 21, 2011 at 04:03 UTC
    What do you think this does?
    eval { $dbh->do("BEGIN IMMEDIATE TRANSACTION"); $dbh->do("DELETE FROM test_bulk_insert"); $sth->execute(@$_) for @batch; $dbh->commit; } or die $@;
Re^2: DBD::SQLite bulk insert woes
by dwalin (Monk) on Jun 21, 2011 at 08:30 UTC
    No it doesn't. You're confusing disk writes with commits which are actually quite different things. I would suggest reading this, this and this articles to gain better understanding of how SQLite transactions and disk writes work.

    In this case it doesn't matter anyway because the database is held in memory and there is no delay due to disk. It's a test focused on DBD::SQLite performance rather than SQLite itself.

    Regards,
    Alex.