# first attempt ... my $start = time; my $dbh = DBI->connect("DBI:SQLite:$dbfile") or die; my $sth = $dbh->prepare( qq(INSERT INTO 'logentries' ('col1', 'col2', 'col3', 'col4') values (?,?,?,?) )); $sth->execute($_->[0], $_->[1], $_->[2], $_->[3]) for @rows; print "et: ", time - $start, " sec\n"; # et: 1082 seconds #### # single transaction ... my $start = time; my $dbh = DBI->connect("DBI:SQLite:$dbfile") or die; $dbh->do('BEGIN'); my $sth = $dbh->prepare( qq(INSERT INTO 'logentries' ('col1', 'col2', 'col3', 'col4') values (?,?,?,?) )); $sth->execute($_->[0], $_->[1], $_->[2], $_->[3]) for @rows; $dbh->do('COMMIT'); print "et: ", time - $start, " sec\n"; # et: 5 seconds