Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

select command - what's the best performance?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
jctgf
Currently Banned

Active User


Joined: 04 Nov 2006
Posts: 109

PostPosted: Sun Dec 16, 2007 7:45 pm    Post subject: select command - what's the best performance?
Reply with quote

Hi there,

I would like execute a select that will generate a cursor with 1000 rows.

I want to skip the first 600 rows and process only the last 400.

I have 2 ways to implement it:

1) I can skip the first 600 rows through my SELECT command:

In this case, my cursor would have only the 400 rows I actually want and my COBOL program would fetch only 400 rows.

My SELECT command is the one that will have the duty to discard the rows I don’t want.

There will be some SCAN in order to accomplish the task. The access plan IS NOT only by an index.

2) My COBOL program can also simply fetch all 1000 rows and bypass the first 600 I don’t want to process:

There will be NO scan.

The access plan IS ONLY by an index.

Which solution provides the best performance?

Thanks,
JC
Back to top
View user's profile Send private message

stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Sun Dec 16, 2007 10:41 pm    Post subject:
Reply with quote

Try it both ways and see. The scan may not be that bad if the table(s) is/are small. If they are large though the select of 1000 and skip to 601 would probably be faster.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts BC, BCR, BRC, BRCL performance steve-myers PL/I & Assembler 0 Fri Dec 23, 2016 7:44 am
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us