On Feb 23, 2009, at 2:44 PM, manohar s wrote:

> Hi,
> I am doing some performance analysis on my SQLite queries. The  
> problem is
> SQLite seems to be caching query results.
> I tried restarting my program, that is not helping. only if i don't  
> access
> that database for 2 days then it is giving proper profile data.
> *
> Question*
> 1) How can I disable query result caching in SQLite?

Assuming you are using SQLite directly, SQLite does not cache query
results. It does cache pages of the database file in memory to reduce
the amount of data loaded from the disk. This cache is just in regular
heap memory, so it is destroyed when the process using sqlite exits.

Probably what you are seeing is that the OS caches recently accessed
file-system sectors. The first time you run the SQLite query data must
be loaded from the magnetic disk. The second and subsequent runs
retrieve data from the OS cache. Much faster.

Dan.





> Regards,
> Manohar.S
> _______________________________________________
> 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