Parts of a Query Plan

The graphic representation of a query plan is a tree structure that provides the details of how DataDirect XQuery will execute the query for which the plan was generated. The query plan tree diagram is read-only, though it does provide navigation and formatting features. You can also print and save the query plan as HTML.

In addition to the Plan node, the query plan tree can include Adaptors, Global Variables, and Local Functions nodes. These nodes are described in the following table.

Node
Description
Adaptors
This node contains a list of database resources that will be involved in the execution of the query. These resources can include JDBC connections, temporary tables, and deferred SQL statements used in the context of DataDirect XQuery update functionality.
Global Variables
This node contains a list of global variables that are available to the query plan, such as external variables defined by the query and variables defined as part of the generation of the execution plan.
Local Functions
This node contains a list of user-defined functions used during the query evaluation. Each user-defined function listed in this node has a plan description associated with it. Plan descriptions are described next.
Plan
This node contains the description of the query execution plan. It contains the nodes of the plan, for example, FLWOR nodes and the nodes within the FLWOR nodes such as for, let, and return.
Table 108. Query Plan Nodes

Navigation

You can navigate the tree to check where variables are defined and where they are referenced. For example, you can navigate from one adaptor's definition to its references and vice-versa.

To navigate the tree, you can

Query Plan Toolbar

The query plan toolbar has buttons that help you navigate the variables defined in your XQuery code. These buttons are described in the following table.

Formatting

You can change the font size used to display query plan text and symbols by right-clicking a tree node and selecting the font size you wish to use. Changes to font size affect the entire query plan, but they are not saved when you save the query plan as HTML.

Saving a Query Plan as HTML

You can save a query plan as an HTML document; you might wish to do this for review or presentation purposes, for example.

To save a query plan as HTML:
1. Select XQuery > Save Plan as HTML from the Stylus Studio menu.

Alternative: Click the Save Plan button on the Plan tab.

The Save As dialog box appears.

2. Choose a path and name for the HTML file.
3. Click Save.
 
Free Stylus Studio XML Training: