db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Knut Anders Hatlen <Knut.Hat...@Sun.COM>
Subject Re: derby.storage.pageCacheSize on multiple databases
Date Wed, 26 Mar 2008 20:36:06 GMT
Guillermo Averboch <acade4u@gmail.com> writes:

> Thanks Knut! 
> Now, doesn't that mean that derby.storage.pageCacheSize should be settable at 
> the database level? In my case, I have one important database, for which I want 
> to have a large cache, and other less important databases, for which 
> performance is not as important, and for which I would like to have smaller 
> caches. But I have no way to specify that, given that 
> derby.storage.pageCacheSize can only be set at the system level (according to 
> the Derby doc.) Now, if I set it at the database level, Derby doesn't complain, 
> but I presume it still ignores the setting, right? 

Yes, that's how it works. The page cache is initialized before the
database properties are read (since database properties are stored in
the database, and the database is read through the page cache).

You may get around this by setting the derby.storage.pageCacheSize
system property before loading each of the databases, something like

  // boot important db
  System.setProperty("derby.storage.pageCacheSize", largeValue);
  // boot less important db
  System.setProperty("derby.storage.pageCacheSize", smallValue);

This seems to do the trick, given that the databases haven't been loaded
in the same JVM process before.

However, I don't see any reason why it should not be possible to set the
page cache size as a database property, and it would certainly be a
useful feature, so I think this is worthy an RFE in JIRA

Knut Anders

View raw message