IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Tell me which takes less CPU time


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harishch_ch

New User


Joined: 07 Jan 2008
Posts: 27
Location: bangalore

PostPosted: Fri Apr 04, 2008 10:33 am
Reply with quote

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
View user's profile Send private message
raviprasath_kp
Warnings : 1

New User


Joined: 20 Feb 2005
Posts: 65
Location: chennai

PostPosted: Fri Apr 04, 2008 2:34 pm
Reply with quote

may be the first one only
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 04, 2008 7:44 pm
Reply with quote

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
View user's profile Send private message
anjani shanker

New User


Joined: 26 Jan 2007
Posts: 37
Location: USA

PostPosted: Fri Apr 04, 2008 8:04 pm
Reply with quote

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 icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 04, 2008 9:04 pm
Reply with quote

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
View user's profile Send private message
ashok_uddaraju

New User


Joined: 21 Feb 2007
Posts: 72
Location: US

PostPosted: Sat Apr 05, 2008 3:01 am
Reply with quote

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
View user's profile Send private message
harishch_ch

New User


Joined: 07 Jan 2008
Posts: 27
Location: bangalore

PostPosted: Thu Apr 10, 2008 8:55 pm
Reply with quote

From the above replies, i understand that commit doesnot make any difference in cpu time , correct me if i am wrog:)
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Apr 10, 2008 9:22 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
Search our Forums:

Back to Top