What is an EXPLAIN in DB2.
How and what is the steps followed in EXPLAIN command. Can
all the queries be used in EXPLAIN command to check the
performance.

Answers were Sorted based on User's Feedback



What is an EXPLAIN in DB2. How and what is the steps followed in EXPLAIN command. Can all the quer..

Answer / yuvaevergreen

>>Explain can be used to improve the performance of queries.
>>Explain command populates three tables
PLAN_TABLE,DSN_STATEMNT_TABLE,DSN_FUNCTION_TABLE. These
tables contains various info about the queries which can be
used for improving the performance.
>>Step1:PLAN_TABLE must be created.
>>Step2:Use explain sql or explain option in Bind to
populate the tables.
>>For example,explain plan set queryno=01 for select empname
from employee;
This would populate plan and statement table.Assigned
queryno would be 01.
>>Alternately EXPLAIN(YES) in BIND option.
>>Only select,insert,update,select for update,delete, delete
current of cursor,update current of cursor can be used in
explain.

Is This Answer Correct ?    7 Yes 0 No

What is an EXPLAIN in DB2. How and what is the steps followed in EXPLAIN command. Can all the quer..

Answer / s.v.venkata sivaprasad

explain is the db2 tool which used to improve db2
performance and provides best access path to package

Is This Answer Correct ?    1 Yes 0 No

What is an EXPLAIN in DB2. How and what is the steps followed in EXPLAIN command. Can all the quer..

Answer / ryan

Whenever we run a query,DB2 creates an access plan that specifies how it will access the requested data. This is created whenever the sql is compiled at bind time for static sql and before execution for dynamic sql.
DB2 bases the access paths on the SQL statements and also on the statistics and configuration parameters of the system.
Even when an sql is made efficient, it can become inefficient as data grows. So, we need to run DB2 runstats  so as to keep updated statistics . DB2 config and storage can change and plans can be rebound. Db2 explain gives us the info for the plan, package, or SQL statement when it is bound. The output of the EXPLAIN  is stored in user-created table called plan table. Whenever we want to tune a query, we need to go and check the plan table so as to get an idea of the access path DB2 optimizer is using.
http://mframes.blogspot.in/2015/01/db2-explain-and-plan-table-column-names.html

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More DB2 Interview Questions

List out the data types available.

0 Answers  


How do you prepare a COBOL + DB2 program from coading till execution ?

1 Answers   Amdocs, Xansa,


What are the different methods of accessing db2 from tso? How is the connection established between TSO & DB2?

3 Answers   Tech Mahindra,


If the main program has only cobol statements and subprogram has the db2 statements what is the procedure for precompilation. for which program we need to do the precompilation

1 Answers   IBM,


what is the soft code for deadlock ?

2 Answers   Logica CMG,






How can you display the current date & current time ?

1 Answers   Cap Gemini,


Which isolation level provides highest data integrity?

0 Answers  


What are the various locking levels available?

3 Answers  


what is the use of bind parameter, Replace?

5 Answers   IBM,


What if we try to insert the base table through updatable view , but failed to give a column value which is defined as NOT NULL.

1 Answers   Cap Gemini,


What are the rules for db2 programming?

0 Answers  


WHAT IS NULL INDICATOR ? WERE IS THIS USED? AND IF IT IS USED IN FILES CONCEPT? HOW DO WE USE IT?

2 Answers   IBM,


Categories