Prepare your statements only once and then use bind.  Do not use 
sqlite3_exec.  Do not open and close the DB for each read, instead open 
once and let the cache work.  Avoid row scans by defining indices.  Use 
the new index selection functionality to force the use of the best 
index.  Place large and less frequently accessed columns at the end of 
the Sqlite rows.

When you obey these rules you will get very good read perfprmance from 
Sqlite.  The cacheing is important if you are using a slow disk or flash 
memory.  Look at shared cache mode if you have multiple users.
JS

MikeW wrote:
> Christophe Leske <[EMAIL PROTECTED]> writes:
> 
> 
>>Hi there,
>>
>>i am using a 120MB database in an embedded project (a DVD-ROM project) 
>>and was wondering what I can do to speed up its reading using diverse 
>>PRAGMA statements.
>>The database is locked, meaning that no data is being inserted or 
>>deleted from it. I am solely after speeding up its reading performance.
>>
>>Indices have been set, would augmenting the cache size for Sqlite do 
>>something?
>>
>>Grateful for any info,
>>
> 
> Did you say that the PRAMGA locking_mode=EXCLUSIVE was set ?
> The doc suggests this speeds things up ...
> 
> You are not clear about which aspect is slow - are you already using 
> sqlite3_bind_x() and placeholders (?) in your SQL statements ?
> Doing a sqlite3_prepare every time you do a query can slow things
> down.
> Sorry if you are already using all code-level best practise !!
> 
> MikeW
> 
> 
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

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

Reply via email to