Using section explain information

Starting from DB2 9.7 Fix Pack 1, DB2 introduced the section explain functionality that allows us to capture explain information using the contents of a run-time section. Using section explains, we can get information about the actual execution values along with the estimated values provided by the EXPLAIN command. In this recipe, we will discuss how we can extract explain information from a section, and compare the estimated and actual values in the access plan.

Getting ready

We should have EXPLAIN tables created before we can capture any explain information.

How to do it...

To obtain the estimated and actual explain information, perform the following steps:

  1. Enable section actuals: Update the SECTION_ACTUALS database ...

Get IBM DB2 9.7 Advanced Application Developer Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.