aspose file tools*
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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
Author

Why result set Interation takes huge amount of time

Mingyu Wei
Greenhorn

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 "resultset.next()" 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!

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

Joined: Oct 14, 2005
Posts: 18541
    
    8

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

Joined: Oct 23, 2005
Posts: 3704
    
    5

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
 
jQuery in Action, 2nd edition
 
subject: Why result set Interation takes huge amount of time