db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øystein Grøvlen <Oystein.Grov...@Sun.COM>
Subject Re: Speed of using Derby DB
Date Wed, 11 Jun 2008 11:32:13 GMT
vodarus vodarus wrote:
> it takes up to 12 seconds to calculate TESTTOTALS. Oracle PL/SQL 
> procedure with the same algorithm need 1,5 second.
> *How can i improve performance? Or Derby is so slow because of Java / 
> JVM issues???*
> Thanks.

I do not have any experience with performance of stored procedures, but 
note that Derby has a pretty high overhead for query compilation since 
it compiles queries directly into Java byte code.  Hence, comparison on 
single executions of statements will usual not be in favor of Derby. 
However, if same statements are executed many times efficiency improves 
(both due to reuse of compiled plans and hot-spot compilation of the 
Java code).

For you particular problem, why use stored procedures when you can do 
the same with the following query:

insert into testtotals
select client, sum(order_amount) from testbig group by client;


View raw message