• Post Reply Bookmark Topic Watch Topic
  • New Topic

Result set Working Ultra slow!!!!!!!  RSS feed

 
RatiKanta pal
Ranch Hand
Posts: 88
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am running a query in db using jdbc.Query is running slow but returns me 8lk record with 32 columns.

But while I am iterating the result set its iterating very slow.100 records this is taking 1 and half minutes approx.

Any idea how to improve its performance.



 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try to break this up and see where the bottle neck is? How long does the same query take to execute on the database?
 
RatiKanta pal
Ranch Hand
Posts: 88
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
what do uou mean by bottle neck please tell me how to check that ,Query is taking 40-50 sec for execution.What is the relation between result set performance with query execution.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RatiKanta pal wrote:what do uou mean by bottle neck please tell me how to check that ,Query is taking 40-50 sec for execution.What is the relation between result set performance with query execution.

Very little I think, particularly since ResultSet normally "queues" rows - that is to say, if the query returns a huge number of rows, the JDBC layer will return them to you in "chunks" - so I doubt that ResultSet is actually your problem at all.

One really simple test: Have you tried running this query directly in the database?

If it takes 40 seconds there, then you have your answer - It's your query that's the problem; not Java or ResultSet.

Winston
 
RatiKanta pal
Ranch Hand
Posts: 88
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Winston ,
Thanks for the suggestion.After improving the query performance its working fast now.
 
Winston Gutkowski
Bartender
Posts: 10575
66
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
RatiKanta pal wrote:Thanks for the suggestion.After improving the query performance its working fast now.

Great!

Sometimes (actually, quite often) the simplest solutions are the best.

Winston
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!