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 > DB2 query behaviour

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-16-07, 08:31
astraia astraia is offline
Registered User
 
Join Date: May 2007
Posts: 1
DB2 query behaviour

Hi ,
I am facing problems with a select query in DB2.The query normally returns results in about 30 seconds when i run it,but sometimes it takes around 2 hrs to return the results.The query reads from a Datamart database and is populated by running batch scripts.
Is there any explanation for this kind of behaviour??
The version of DB2 i am using is DB2 v8.1.7.445
Reply With Quote
  #2 (permalink)  
Old 05-16-07, 08:51
ARWinner ARWinner is offline
Registered User
 
Join Date: Jan 2003
Posts: 3,575
There can be numerous reasons why. Anything from poorly written SQL, lock contention, DB and DBM configuration issues, old or nonexistant runstats, etc, etc.

The first place I would start would be to generate access plans on the EXACT SQL running. This will let you know if you are doing table scans on the wrong tables. Also you need to monitor the system while queries are active to check for lock contention.

Andy
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