• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make a query faster.

 
Gorakshanath Pandey
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
 
David Peterson
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?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36027
431
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.
 
When it is used for evil, then watch out! When it is used for good, then things are much nicer. Like this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!