MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SORT THEN SEQUENCIAL READ VS DB2 CURSOR

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
issac1029
Intermediate


Joined: 10 Dec 2005
Posts: 159
Topics: 75

PostPosted: Thu Nov 02, 2006 1:58 am    Post subject: SORT THEN SEQUENCIAL READ VS DB2 CURSOR Reply with quote

A)
There is a file, I sort by key,then filtered useless one. In main program
I read the file processed by sort.

B)
In main program , declare a cursor, then fetch one by one.

Which is more faster? Or how to evaluate the efficiency?
Back to top
View user's profile Send private message Send e-mail MSN Messenger
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Thu Nov 02, 2006 2:08 am    Post subject: Reply with quote

issac1029,

Are u talking about a situation something like this ?

A)First u had unloaded the data from a DB2 table to a Flat File in a sorted manner and then made use of a COBOL DB2 program to read in file sequentialially and used that key to be a part of the SQL query .This kind of retrieval is useful if the data is huge and coding Program without Cursors.

B)You are making use of a COBOL DB2 Program with cursor and retrieving and processing information record by record.


If you compare both the situations i think the first condition is more efficient.Hope this helps.
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
issac1029
Intermediate


Joined: 10 Dec 2005
Posts: 159
Topics: 75

PostPosted: Sat Nov 04, 2006 9:06 am    Post subject: Reply with quote

shekar123,

If data is huge,then choose A) ? I also prefer that intuitively when I first think about this. But when the data only have hundreds of records? Neutral
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group