What caching does SQLite do on Android?

I would like to know more about what SQLite caching is and how Android adjusts cache parameters (I read that they can be controlled with pragmas at compile time.) Does anyone have a deeper understanding of this or even rely on SQLite as effective cache for caching data received from the network?

I understand that SQLite caches pages in memory by default. Is there a request cache and is there any way to configure these parameters from an Android client application even?

The only thing I can find is SQLiteDatabase # setMaxSqlCacheSize, but this is only for prepared statements.

+4
source share
1 answer

Use PRAGMA cache_size = xx to set the page cache. The number is in units of pages, and the default page size is 1024 bytes. This is no different from SQLite on any other platform. You should also take a look at SQLightning, which uses LMDB as its storage engine and does not require cache tuning.

https://gitorious.org/mdb/sqlightning/source/5a70c78cc0c7b9393ff1373905bf1a852cfab3bc :

+1
source

Source: https://habr.com/ru/post/1543368/


All Articles