db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: Really need some help here please. I think I am having a problem with some sort of caching in Derby
Date Wed, 28 Mar 2012 19:27:09 GMT
optimization time can definitely be a problem with derby, anything you 
can do to make it easier on the optimizer probably helps your 
application a lot.

I still don't understand the correlation of running full GC to the 
optimizer issues.

Logically the optimizer is meant to self regulate, I think it might
set some max expected query time at the start of it's loop and then
replace it as it evaluates each query plan.  It tries to only
run as long as it estimates the query is going to run.  There have 
definitely been problems in the past with many way joins where a 
slightly bad estimate muliplied many times over can lead to optimizer
thinks the query is going to take way longer that it actually does and 
thus leading it to spending more time in the optimize phase. The problem
is that those estimates have grown out of date with faster and faster
machine.  the amount of work in the optimizer is something like N!
where N is the number of tables + indexes (including constraints, 
primary keys, other indexes) on the tables in a query.

As you have said I think your application is in new area compared to
most derby applications.  I would say most applications compile
queries once and execute them multiple times in the kind of high
utilization environment you are describing.

View raw message