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

How connect db2 database to datastage?

765


What is a bind in db2?

594


What is the difference between dbm cfg and db cfg file in db2 ?

1007


What does db2 blu stand for?

662


Which are the db2 tools to protect integrity of the database?

692






What is the difference between bind and rebind in db2?

858


What is query_cache_limit?

545


What type of database is db2?

525


What is bind and rebind in db2?

652


by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?

7518


I understand Join always perform better than subqueries. Then what is the advantage/use of Subqueries/correlated subqueries etc.,in DB2 programming.Please explain.

1651


Which component is responsible for db2 startup and shutdown?

630


What is syscat in db2?

580


Explain db2.

620


What is the reason behind not using select * in embedded sql programs?

603