On Thu, 28 Mar 2013 08:43:50 -0400
Jeff Archer <jsarc...@nanotronicsimaging.com> wrote:

> >         When you turn off journalling, you save something; when you
> >         consolidate the activity into a single transaction, you save
> >         something else.  What you're seeing is that the saving
> > achieved with reference to your base-line measurement by using a
> > single transaction exceeds that achieved by disabling journalling.
> >
> >         /Niall
> >
> 
> Agreed.  But the question is: Why?  Without journaling only half as
> much writing to disk should occur so why would it take longer?

Jeff, you seem to working from the assumption that turning off
journalling should be the secret sauce because I/O is (or should be)
the dominant factor.  Your experiment is telling you
different: transaction control costs more than I/O.  

There are two ways you can think about it.  

1.  Look at the code path through SQLite to perform an insert.  If
you're like me, you'll give up before you get all the way through.  I
don't see any wasted motion, but there's a lot of work.  

2.  Consider the analogy to write(2).  Many small writes take longer
than one large one (up to some value of "large").  Without testing on
your system, I can tell you that writing 1 byte 5764 times, will take
more than 2X the time to write 5764 bytes one time.  

The OS has some overhead to handling a write operation, yet makes
no ACID promise.  (Not even durability!)  SQLite makes a higher
promise, if you will, at a higher price.  Per transaction.  

HTH.  

--jkl


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to