Click the button on the right to find out the average query time for the XML query used in the previous page.
This page also shows you how to obtain the access plan of the XML query executed in the previous page. From the access plan, you can identify any inefficient access and make some tuning accordingly.
Explain Snapshot
Run the following steps on the DB2 CLP window to view the explain snapshot :
PerformanceXQuery.sql
and replace '~~~SCHEMA~~~' with the Default Schema.PerformanceXQuery.sql
DBNAME
-1 -o explain_xmlquery.out
. Replace DBNAME
with the database you are working on. The Explain Plan can be viewed in the output file explain_xmlquery.out
.Click here to view the sample output of the Explain Access Plan : Sample Explain Access Plan
Total cost captured in access plan
Review the explain output and locate the Total Cost
right above the access graph. The sample plan above shows a total cost of 53055.1.
Operation in access plan
The access plan shows the XSCAN operator scanning the XML document
and a TBSCAN scanning the relational data and then joining the result
set of two operations.
XSCAN operator
This operator is used to navigate XML fragments to evaluate XPath expressions and to extract document fragments if needed. This operator processes node references passed by a nested-loop join operator (NLJOIN). It is not represented with a direct input in the access plan.