preparedStatementCacheSize property

int preparedStatementCacheSize
final

The amount of prepared statements to cache.

For each SQLite connection, up to preparedStatementCacheSize statements will be cached in an LRU cache. This allows re-using prepared statements instead of parsing and optimizing them again, which improves performance for frequently-used statements like watched queries.

Be aware that active prepared statements may alter the operation of the database, for instance because they might keep some database resources locked. Statements are CommonPreparedStatement.reset before being stored in the cache, but enabling a statement cache is still something that should be tested carefully.

This is currently disabled by default (set to 0).

Implementation

final int preparedStatementCacheSize;