On Mon, 29 Sep 2008 03:44:46 -0700 (PDT), devesh tiwari
<[EMAIL PROTECTED]> wrote in [EMAIL PROTECTED],
General Discussion of SQLite Database
<sqlite-users@sqlite.org>:

>Hi all,
> I am working on an application that frequently uses
> multiple files for storing and retrieving data.Now
> the number of files to store data as reached around
> 150 and it is becoming difficult to handle multiple
> files so i decided to move to a database system. When
> I heard of sqlite, I thought this can solve my
> purpose as no configuration is required. 
> 
> When I used sqlite to store data, I discovered that
> writing/reading data using sqlite is vary slow as
> compared to direct reading/writing file(in my case 10
> times slower).
> 
> I wonder if sqlite is really slow or i am missing
> something at my end.
> 
> Does sqlite does any caching of frequently used data

It does. The page cache lives between sqlite_open() and
sqlite_close(). So, you'd best open the database at
application start and close it when the application exits.
You can influence the (default) size of the page cache with
a PRAGMA.

Don't forget to wrap any SQL that modifies the database
(INSERT, UPDATE, DELETE) in a transaction (BEGIN / COMMIT).

http://www.sqlite.org has more on performance optimisation.
It's also interesting to read about its architecture.

> or only relies on OS caching?

The OS cache comes on top of the internal cache.
   
>
>Thanks & Regards
>Devesh Kumar Tewari

-- 
  (  Kees Nuyt
  )
c[_]
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to