I know DB2 V7.2 have plan_table and EXPLAIN facility from the documentation!
But I don't know how to use it and how to obtain the execution plan by using the tools! Would you mind tell me that the method to obtain the execution plan of a SQL Statement in DB2??
If you do not already have the explain tables, their DDL in in EXPLAIN.DDL so go into DB2 command mode and issue the command:
db2 -tf EXPLAIN.DDL
If you are using the control centre, you navigate to the db in question and rm-click to bring up the facilities, one of which is "Explain DDL". Follow the GUI from there and you get the explain tables populated and automatically analysed, including CPU; elapsed with colour gradation and expandability (I rarely use it but for faulty indices it is brilliantly simple).
If you are NOT using the GUI, you have db2expln and dynexpln etc. Refer to the Admin guide for specific details.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.