View previous topic :: View next topic
|
Author |
Message |
harishch_ch
New User
Joined: 07 Jan 2008 Posts: 27 Location: bangalore
|
|
|
|
Hi,
I got 100 records with my query,
Tell me which takes less CPU time?
1) Commiting ( uPdating/Deleting etc) all 100 at a time.
2) Commiting 50 once and 50 then.
Plz give a quick response.
thanks
Hari. |
|
Back to top |
|
|
raviprasath_kp Warnings : 1 New User
Joined: 20 Feb 2005 Posts: 65 Location: chennai
|
|
|
|
may be the first one only |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Tell me which takes less CPU time? |
Issuing a COMMIT should not be based on cpu time. . .
A COMMIT should be issued to support checkpoint/recovery. Your c/r strategy will determine when you should issue a COMMIT - typically after a logical unit of work (LUW).
Doing 1 versus 2 COMMITs would be somewhat difficult to measure as the difference would be slight. |
|
Back to top |
|
|
anjani shanker
New User
Joined: 26 Jan 2007 Posts: 37 Location: USA
|
|
|
|
Committing does increase the run time for pgm to some extent...but keeping the updates waiting for commit means you are increasing the entries in buffer (logfiles) which is a very unefficient way to code.
Its better that u code like update 50 and commit them...rather than update all and then commit all....
I think the first one would that less time of 2 u mentioned...Plz correct me if I am wrong |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Committing does increase the run time for pgm to some extent... |
Why do you think so? It would be helpful if you run a few tests and post your findings.
Quote: |
but keeping the updates waiting for commit means you are increasing the entries in buffer (logfiles) which is a very unefficient way to code |
Regardless of when you issue COMMITs, the entries will still be in the log files. |
|
Back to top |
|
|
ashok_uddaraju
New User
Joined: 21 Feb 2007 Posts: 72 Location: US
|
|
|
|
Probably 100 is not large number so it does not make any difference on 1 commit or 2 commits, but when data is too alrge we better go for 2 commits |
|
Back to top |
|
|
harishch_ch
New User
Joined: 07 Jan 2008 Posts: 27 Location: bangalore
|
|
|
|
From the above replies, i understand that commit doesnot make any difference in cpu time , correct me if i am wrog:) |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
The number of commits would make a difference in the CPU time, but that should not be the only reason for determining the number or frequency of the commits. |
|
Back to top |
|
|
|