I used the PRAGMA statement and turned off the synchronous option.  It
made a huge difference.  Single inserts were ranging from 5 - 50 ms,
now, they're at ~.04 ms.

However, I guess there is a tradeoff between the safety of the
synchronous operation (in case power is lost) versus the insert
speeds.

Thanks for the help,
Mark

On Dec 3, 2007 12:59 PM,  <[EMAIL PROTECTED]> wrote:
> "P Kishor" <[EMAIL PROTECTED]> wrote:
> > I get 1000+ inserts a second for a random 100 byte string
> > insert (
>
> I get 50000+ inserts/sec on my Linux box.
>
> Insert speed is not the issue.  It is COMMIT speed.  At
> each commit, SQLite waits until all data is on oxide before
> continuing.  That will typically take at least two rotations
> of the disk platter, or about 17 millisecond, depending on
> your disk drive.  Waiting for data to get to oxide is
> part of being ACID.  You can set:
>
>    PRAGMA synchronous=OFF;
>
> and your COMMITs will go *much* faster because it will no
> longer wait on the disk drive.  But if you lose
> power in the middle of a commit, you might corrupt your
> database file.
>
> Note that there is an implied BEGIN...COMMIT around every
> INSERT statement if you do not explicitly start a transaction
> using your own BEGIN.
>
> --
> D. Richard Hipp <[EMAIL PROTECTED]>
>
>
>
> -----------------------------------------------------------------------------
> To unsubscribe, send email to [EMAIL PROTECTED]
> -----------------------------------------------------------------------------
>
>

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to