How do I use DB2\'s Explain function? -- both to run it, and to use it to optimize queries. Is there a better tool available for DB2?
I\'ve built queries before, bu
What you're looking for is covered by two DB2 utilities:
Both utilities require specialized tables to be created in the database.
I tend to use the explain utility more than the advisor, especially if I am able to change the SQL for the query to influence a better access plan. I use the db2expln command-line utility to explain different versions of a query I'm tuning and compare their costs. What's most important is that your table and index statistics are up to date when running explain or the design advisor.