File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes Why result set Interation takes huge amount of time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Why result set Interation takes huge amount of time" Watch "Why result set Interation takes huge amount of time" New topic

Why result set Interation takes huge amount of time

Mingyu Wei

Joined: Jul 08, 2008
Posts: 1
Hello Everyone,

I am using Derby as my project's embedded database.

In the database, there are several tables storing 64k nodes related information.

After trying to issue a query (contains four table joins) against database, I found that it took huge amount of time

waiting for the step "" to be completed (I put some printout msgs before and after that call and from the console output, it looked like it was stuck in that step.)

Some environment information:

OS: Redhat Linux
Total memory is 2G
The derby database cache is 1.6G
The JVM heap size is 1.5G

Has anyone experienced that before?
Or do you have any ideas or suggestions on that?

Any suggestion is greatly appreciated!

[ July 09, 2008: Message edited by: Mingyu Wei ]
Paul Clapham

Joined: Oct 14, 2005
Posts: 18541

"whiz", please check your private messages regarding a matter of administration.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703

Welcome to the world of database performance: never assume anything runs quickly. Since the JDBC code for next() is pretty trivial, the problem most likely lies in the database itself. Most commonly, if you add proper indexes (use a database performance tuning tool if you don't know which indexes to ad) will solve your problem although if its completely stuck, it may be a key locking issue.

My Blog: Down Home Country Coding with Scott Selikoff
I agree. Here's the link:
subject: Why result set Interation takes huge amount of time
Similar Threads
concurrent access to derby database
Derby Support
Embedding Derby
How to use Derby DB in J2EESDK ?
Error loading derby driver