- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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.
- 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?
- What are the default values used by DB2 for various data types?
- How to find out all the indexes for a DB2 table TAB1?
- SQL statement to add a table as Virtual table in SAP HANA Smart Data Access
- How to check the memory used by a program in Java?
- Implementation of a table level locks in a COBOL-DB2 program during SQL execution
- Write a SQL query to count the number of duplicate TRANSACTION_ID in an ORDERS DB2 table
- How can Tensorflow be used to create a pair using a file path for the flower dataset?
- Usage and example of Multi-index and Index-only access path in DB2
- How to precompile a COBOL-DB2 program?
- How can we set up a MySQL User account by using SQL GRANT statement?
- Program to find a path a continuous path in a rectangular area without engaging a bomb in Python