db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kristian Waagan <Kristian.Waa...@Sun.COM>
Subject Re: Is it any optimization for BATCH queries for Derby?
Date Thu, 18 Oct 2007 07:17:46 GMT
Templexp Tan wrote:
> Is it any optimization for BATCH queries for Derby?
> how about the speed for inserts?
> which one will be suitable for batchquery?  the statement or 
> preparestatement ?
> it seems a little bit slow to insert a bunch of data into the DB. 
> it is about 7ms for ORACLE (100 queries in batch)
> but it tooks 20ms for DERBY (100 queries in batch)
> and the worse case is that it goes slower and slower if I have more than 
> 30000 rows data in it.
> there is one index in the table. I don't think it gonna cost too much.
> any idea to speed up?


Questions like these are generally hard to answer without knowing the 
full story. Also, I don't know Oracle.

A few thoughts:
  * Are you using Derby embedded or client/server?
  * Is the load program singlethreaded or multithreaded?
  * Are the data and the log written to separate devices? (set with 
logDevice in the connection URL upon creation)
  * Do you run with autocommit off in both databases? If yes, how often 
do you commit?
  * How big (approx) are your rows?
  * Have you adjusted the page cache size?
  * What about the Java heap size and garbage collection?
  * Java version?
  * Derby version?

That's what I can think of right now. Maybe someone else chimes in with 
suggestions too. If you post the code, it might be easier to see if
anything can be done to speed up Derby.



View raw message