Java DB

Apache Derby

Derby Performance Tuning

Derby Getting Started
Derby Reference Manual
Derby Developer's Guide
Derby Performance Tuning
Derby Server and Admin Guide
Derby Tools and Utilities
Derby Performance Tuning
-Performance tips and tricks
-Tuning databases and applications
-DML statements and performance
-Performance and optimization
-Locking and performance
-Non-cost-based optimizations
-Overriding the default optimizer behavior
-Selectivity and cardinality statistics
-Internal language transformations
-Predicate transformations
-Transitive closure
-View transformations
-Subquery processing and transformations
-Outer join transformations
-Sort avoidance
-Aggregate processing
-

 

Increase the size of the data page cache

You can increase the size of a database's data page cache, which consists of the data pages kept in memory. When Derby can access a database page from the cache instead of reading it from disk, it can return data much more quickly.

The default size of the data page cache is 1000 pages. In a multi-user environment, or in an environment where the user accesses a lot of data, increase the size of the cache. You configure its size with the derby.storage.pageCacheSize property. For more information about how to set this property and how to estimate memory use, see the "Derby properties" section of the Derby Reference Manual.

Note: Derby can run even with a small amount of memory and even with a small data page cache, although it might perform poorly. Increasing the amount of memory available to Derby and increasing the size of the data page cache improve performance.

In addition, you might want to prime all the caches in the background to make queries run faster when the user gets around to running them.

These caches include:
  • The page (user data) cache (described above)

    Prime this cache by selecting from much-used tables that are expected to fit into the data page cache.

  • The data dictionary cache

    The cache that holds information stored in the system tables. You can prime this cache with a query that selects from commonly used user tables.

  • The statement cache

    The cache that holds database-specific Statements (including PreparedStatements). You can prime this cache by preparing common queries ahead of time in a separate thread.

 

javadb@jdbcurl.com