Performance of DB2 select query

Ask question on - DataBase Concepts, IBM Mainframe DB2, DB2/UDB, DB2 Tools, SQL , DB2 programming with languages like COBOL, PL1.

Moderators: Kalicharan, Moderator Group

Post Reply
mailgvs
Member
Posts: 1
Joined: Fri Mar 04, 2011 3:02 am

Performance of DB2 select query

Post by mailgvs » Fri Mar 04, 2011 3:14 am

I am using a large DB2 table which contains data with LRECL of 710 bytes. The volume of records in this DB2 table is high in terms of millions.


Currenlty, we have a job to unload the entire table based on certain criteria. This process runs daily and selects the entrie 710 bytes of record into a flat file. But, my main routine/program that reads this file is only using few fields from DB2 table (roughly 110 bytes).

Can I write a only selective query(SELECT field1, field2 from table) for the fields that are used in my main routine instead of SELECT * from table; ?

Will this provide any CPU savings or execution time savings

The Butcher
Member
Posts: 2
Joined: Sat Mar 19, 2011 9:02 pm

Post by The Butcher » Sat Mar 19, 2011 9:24 pm

Hello there,
I am a little confused here. If your program is reading from the flat file (subset of the large table), why does your program need to do any SQL call again?
Best Regards,
The Butcher

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Wed Mar 23, 2011 1:57 pm

each utility that is used to unload a table has a syntax for specific select.
check the documentation for the utility used.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

User avatar
DFSHDC40
Member
Posts: 4
Joined: Mon Mar 21, 2011 4:11 am
Location: IMS.SDFSRESL

Post by DFSHDC40 » Thu Mar 24, 2011 6:12 am

Can I write a only selective query(SELECT field1, field2 from table) for the fields that are used in my main routine instead of SELECT * from table; ?
Yes
(usually columns not fields)

Will this provide any CPU savings or execution time savings
Depends on what is selected
If the code hasn't been changed, why is the LKED date today?

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others