If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > hash joins

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-03-08, 11:26
oracle10gsingh oracle10gsingh is offline
Registered User
 
Join Date: Nov 2007
Posts: 72
hash joins

Hi All,

my application is running very slow also cpu usage is also pretty high i had taken a database snapshot which says number of hash joins are in 100's and in some queries its close to 2000 ..i guess this is not a good sign because indexes are not being defined properly ..and db2 is creating hashing table during the execution of query.....what i conclude is number of hash joins should be reduced ...that will bring down the cpu utilisation as well ...

my question is ....am i correct in drawing in this inference ? if so ..what should be done ? (using db2advis tool to define proper indexes ) if not ..why so many hash joins ?

Thanks
Reply With Quote
  #2 (permalink)  
Old 11-03-08, 14:12
n_i n_i is offline
:-)
 
Join Date: Jun 2003
Location: Toronto, Canada
Posts: 4,449
1. "application is running very slow" and "cpu usage is also pretty high" are not necessarily related.

2. hash joins and the use of indexes (or presumed lack thereof) are not necessarily related

3. hash joins are not necessarily a bad thing

4. defining proper indexes is always a good thing
Reply With Quote
  #3 (permalink)  
Old 11-04-08, 03:43
nick.ncs nick.ncs is offline
Registered User
 
Join Date: May 2007
Location: somewhere in dbforums
Posts: 221
You should also look at the visual query plan for the queries which your application is basically executing.... maybe you can get something over there as well... then maybe you can decide whether your indexes , if present, are being used

As far as your CPU utilization is concerned, it is very open-ended as to what the problem can be.... as there can be a possibility that application server too is present on the same box which will be utilizing the system resources...
Reply With Quote
  #4 (permalink)  
Old 11-04-08, 16:13
dbadam dbadam is offline
Registered User
 
Join Date: Sep 2004
Posts: 12
Hi oracle10gsingh

Whats the value of sortheap ? If it's default try to increase it and make sure you have also increased sortheap_threshold

thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On