Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: DBI::SQLite slowness

by Anonymous Monk
on Sep 20, 2013 at 12:47 UTC ( [id://1055016]=note: print w/replies, xml ) Need Help??


in reply to DBI::SQLite slowness

You must perform SQLite operations in a transaction, because if you do not, it will re-read and re-verify e-v-e-r-y I/O operation, by design.

Replies are listed 'Best First'.
Re^2: DBI::SQLite slowness
by Endless (Beadle) on Sep 20, 2013 at 17:59 UTC
    If I simply have "$dbh->commit" following the For loop, is that effectively the same as explicitly using transactions?
      If I simply have "$dbh->commit" following the For loop, is that effectively the same as explicitly using transactions?

      No; BEGIN WORK (or BEGIN TRANSACTION or just plain BEGIN) starts a transaction in SQL. Then (normally after 1 or more insert/delete/update's) COMMIT commits the transaction (or, when an error occurs, ROLLBACK rolls the transaction back to the state just before the BEGIN).

      See DBI's begin_work

      (I don't use SQLite; in the above I am assuming SQLite does this the same way that other (RDBMS) databases do)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1055016]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2025-07-14 09:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.