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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Can one database have multiple instances?

579


What is cursor in dbms?

582


How can the firstname and the lastname from the emp table be concatenated to generate complete names?

740


Name the lockable units in DB2?

661


What db2 400?

673






How do I add a column to an existing table in db2?

587


i want to maintain uniqueness on pdf without make lf??????????

1629


Explain the contention situations caused by locks?

588


what are bind concepts in db2 cobol?

645


What is reorg and runstats in db2?

686


Mention the location where the output received from explain statement is stored.

628


Why do we bind in db2?

626


Which component is responsible for db2 startup and shutdown?

622


What is the clustering index in the db2 database?

580


What are sqlcodes –803,-805, -811, -818,-904,-911,-913,-101, +100?

704