The db2expln tool describes the access plan selected for static SQL statements in the packages stored in the system catalog tables. It can be used to obtain a quick explanation of the chosen access plan for packages for which explain data was not captured at bind time.
The dynexpln tool describes the access plan selected for dynamic statements. It creates a static package for the statements and then uses the db2expln tool to describe them.
Note: | Using this method of analysis is not as accurate as using the Explain Facility. |
You can use these Explain tools to understand the access plan chosen for a particular SQL statement. Or, you could use the integrated Explain Facility (Chapter 14. "SQL Explain Facility") in conjunction with Visual Explain to understand the access plan chosen for a particular SQL statement. Both dynamic and static SQL statements can be explained using the Explain Facility. One difference from the Explain tools is that with Visual Explain the Explain information is presented in a graphical format. Otherwise the level of detail provided in the two methods is equivalent.
To fully use the output of db2expln, and dynexpln you must understand:
The following topics provide information about db2expln and dynexpln:
You can use the db2exfmt tool to format the contents of the explain tables. For more information, see "db2exfmt - Explain Table Format Tool".