• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make a query faster.  RSS feed

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a sql query which works well. but the only problem with it
is its extremely slow.Its a compound query and i have to query DB2
database.I am using Java/JDBC to write a stored procedure
 
author
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to identify the bottleneck: is it JDBC or DB2? Run the query from a command-line tool (i.e. not through JDBC). Is it still as slow?
 
author & internet detective
Marshal
Posts: 37708
578
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you try adding indexes to your table? Also, try posting the query. Maybe someone here can give you tips on it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!