View previous topic :: View next topic |
Author |
Message |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Thu Nov 02, 2006 1:58 am Post subject: SORT THEN SEQUENCIAL READ VS DB2 CURSOR |
|
|
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 |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Thu Nov 02, 2006 2:08 am Post subject: |
|
|
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 |
|
 |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Sat Nov 04, 2006 9:06 am Post subject: |
|
|
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?  |
|
Back to top |
|
 |
|
|