- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to find the access path selected by an optimizer for a SQL statement used in a DB2 program?
The access path gives us the path selected by the optimizers in order to fetch the result of the SQL query. It gives us an idea about what all indexes and parameters will be used by the optimizer.
To get the details of the access path used for the SQL statements within COBOL-DB2 program we can use the EXPLAIN option during the BIND step. Below is the JCL step which can be used.
//BIND EXEC PGM=IKJEFT01 //STEPLIB DD DSN=DIS.TEST.LOADLIB,DISP=SHR //SYSOUT DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(TB3) BIND PLAN(PLANA) - PKLIST(PACKA) - ACQUIRE(ALLOCATE) - ISOLATION (RS) - EXPLAIN(YES) /*
The EXPLAIN BIND option with YES parameter will insert the access path related information in the PLAN_TABLE DB2 table. We can refer to this table after the execution of the BIND step to get an idea about the access path.
- Related Articles
- How to find out the access path selected by optimizer for a particular query?
- What will happen if a NULL value is detected for a SQL statement in COBOL-DB2 program and the NULL indicator is not used?
- Write the DB2 SQL query to find the third highest ORDER_TOTAL in a ORDERS DB2 table
- How to executes an SQL SELECT statement in a JSP?
- SQL Server Query to Find All Permissions/Access for All Users in a Database
- SQL statement to add a table as Virtual table in SAP HANA Smart Data Access
- Implementation of a table level locks in a COBOL-DB2 program during SQL execution
- Usage and example of Multi-index and Index-only access path in DB2
- Write a SQL query to count the number of duplicate TRANSACTION_ID in an ORDERS DB2 table
- How to provide & remove user access to/from DB2 object? Give the DB2 commands?
- How to find out all the indexes for a DB2 table TAB1?
- What are the default values used by DB2 for various data types?
- How to precompile a COBOL-DB2 program?
- How can TensorFlow be used to define a loss function, an optimizer, train the model and evaluate it on the IMDB dataset in Python?
- What is the execution result when non-SQL changes are made in a DB2 program without BIND?

Advertisements