Can I change the size of the memory cache differently for different databases?

I have an application using SQLite. It uses seven different database files, each of which has a connection created using sqlite3_open . Six of them are not performance critical, but one of them.

I would like to increase memory caching in a critical database connection using PRAGMA cache_size . However, this changes the cache size for all connections. I do not have enough memory for each of the seven databases to use as much memory as I need for mission-critical work.

I confirmed that the setting affects all connections. And I confirmed that there is no shared pool - each connection is individually limited by the specified amount of memory.

Is there an easy workaround?

+4
source share
1 answer

PRAGMA cache_size affects only one database connection.

Make sure your connections are not shared (using sqlite3_enable_shared_cache or SQLITE_OPEN_SHAREDCACHE ).

+3
source

All Articles