Hi Pavel,

On 7/9/2011 10:16 PM, Pavel Ivanov wrote:
1. If we have a 1MB cache (1000 pages x 1KB/page), is it allocated
immediately and used or is it allocated as queries come in?
Cache is not allocated immediately. It's allocated when SQLite needs
to read something from disk (or write a newly created page). SQLite
reads it and caches.

2. Does the cache keep filling up till it's full, i.e., each new query that
accesses a different page causes the cache to fill up with those pages - or
does it reuse pages when new queries happen even if the cache is not full?
It fills up until it's full.

3. Does the cache store only results or does it store the table data?
Cache stores raw database pages (which can be table data or indexes).
So, I'd say the general rule should be the bigger the database the
bigger the cache should be for a comfortable work.

Thank you for your answers - this gives me enough ideas on managing memory in our systems better!

Thanks,
Mohit.
8/9/2011 | 1:28 AM.


_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to