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 > SQL execution and commits time

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-14-04, 10:52
diwakarubnare diwakarubnare is offline
Registered User
 
Join Date: Sep 2004
Posts: 3
SQL execution and commits time

Hi guys,

Can you please let me know your thoughts on the following:

We have on update query, which simply updates on record in a table with where condition as it primary key, but it take about 0.5 to 1 sec. This particular query is excecuted so many times because it is used in sequence number generation in our application.

Q. In SQL snapshots, does the excecution time shown includes the time it takes to execution+commit or just excecution?

In our implementation we have a table with one record for every parallel sequence that we need in the application, and we store the current sequence no.
We update this current sequence no = sequence no +1 on every transaction's commit. This particular update is taking a very long time and also generating locks on the table.

Q. What can be done to avoid this?

Thanks,
Diwakar
Reply With Quote
  #2 (permalink)  
Old 10-14-04, 11:29
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
To know the execution time of a SQL Statement, event monitors should be used ... Event monitors give a clear split up of the time taken by various processes (like execution, open cursor, prepare, close cursor, commit/rollback) including sort time, lock wait time etc.

For Q2, why not use SEQUENCE Objects which are not locked ? BTW, what version of db2 are you on ?

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 10-15-04, 10:30
diwakarubnare diwakarubnare is offline
Registered User
 
Join Date: Sep 2004
Posts: 3
Satya,

We are using DB2 UDB v7.2... Will the snapshot/event monitor will give the commit time too...

Thanks,
Diwakar
Reply With Quote
  #4 (permalink)  
Old 10-15-04, 17:31
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Yes ...

And 7.2 does have sequences, which you can make use of ..

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
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