caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Evan Martin <martine@danga.com>
To: Stefano Zacchiroli <zack@bononia.it>
Cc: caml-list@inria.fr
Subject: sqlite performance [was Re: [Caml-list] [announce] ocaml-sqlite 0.3.5]
Date: Fri, 16 Apr 2004 20:00:14 -0700	[thread overview]
Message-ID: <20040417030014.GA14011@lulu> (raw)
In-Reply-To: <20040415135311.GA1441@fistandantilus.takhisis.org>

On Thu, Apr 15, 2004 at 03:53:11PM +0200, Stefano Zacchiroli wrote:
> On Thu, Apr 15, 2004 at 08:44:38AM -0500, John Goerzen wrote:
> > Stefano, do you plan to package this up for Debian?  I'd definately
> > like to see it there.
> 
> I'm interested in principle to the package, and I've also already did
> the packaging for an older version. But if the performance are still
> those I've seen last week, then the package is completely useless to me
> and I wont be interested in maintaining it.

Hi Stefano,

I'm hardly a SQLite expert, nor is the caml-list really the place for me
to answer, but my first guess is this:

SQLite is file backed.  That means any SQL that modifies the database
will actually write out to the file system.  As I recall, there are ways
to change this behavior throughout SQLite (but I can't remember them
well enough to know whether ocaml-sqlite allows them-- I believe you
just need to execute some SQL code using a special PRAGMA statement?).

But more simply and importantly, SQLite only commits to the file when a
transaction is completed.  (There's an implicit transaction around every
INSERT / UPDATE, etc. if you don't specify a transaction yourself.)
I've seen significant performance increases by wrapping repeated
modifications of large datasets with transactions (by using the SQL
statements "BEGIN;" and "END;"), which allows the disk access to be
batched.  With those in place, my simple programs have seen orders of
magnitude increases in performance.

-- 
Evan Martin
martine@danga.com
http://neugierig.org

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  parent reply	other threads:[~2004-04-17  3:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-14 22:16 [Caml-list] [announce] ocaml-sqlite 0.3.5 Evan Martin
2004-04-15  9:51 ` Stefano Zacchiroli
2004-04-15 13:44   ` John Goerzen
2004-04-15 13:53     ` Stefano Zacchiroli
2004-04-15 16:27       ` John Goerzen
2004-04-17  3:00       ` Evan Martin [this message]
2004-04-18 16:10         ` sqlite performance [was Re: [Caml-list] [announce] ocaml-sqlite 0.3.5] Stefano Zacchiroli
2004-04-19 15:16           ` Mikhail Fedotov
2004-04-19 15:52             ` Stefano Zacchiroli
2004-04-15 14:22     ` [Caml-list] [announce] ocaml-sqlite 0.3.5 Richard Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040417030014.GA14011@lulu \
    --to=martine@danga.com \
    --cc=caml-list@inria.fr \
    --cc=zack@bononia.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).