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: Pathologically poor query performance - advice required
Date Fri, 27 Jun 2008 15:10:36 GMT
Matt Doran <matt.doran@papercut.com> writes:

>> To get feedback from people it may also help to post the ddl of the
>> tables in the query, including the indexes/constraints.  I know you
>> provided the db, so with work it is available - but the more up front
>> info you provide the more help possible.
> I've attached the database creation script if anyone is interested.
>> One other suggestion might be to try the query once with no optimizer
>> timeout to see if it would have found a better plan:
>> http://wiki.apache.org/db-derby/PerformanceDiagnosisTips
> I tried disabling the optimizer timeout, it had not effect.  It was
> the maxMemoryPerTable that had the impact here.

Another thing that may affect which plan the optimizer chooses, I think,
is the size of the Java heap. Also, when the optimizer checks how much
memory it has available, it looks at the current size of the Java heap,
not at how much the heap is allowed to grow. So say you've allowed the
heap to grow to 512MB by specifying -Xmx512M on the command line, Derby
doesn't see that it has that amount of memory available until the heap
has actually grown to that size. And the heap doesn't normally grow
until garbage collection cannot free enough memory. To ensure that Derby
always sees how much memory it has available, also set the minimum heap
size with -Xms. Not sure if it helps in your case, but it might be worth
a try.

Knut Anders

View raw message