<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Query+Plans">Query Plans</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >* Select Columns - the columns that define the projection <br>* Grouping Columns - the columns used for grouping <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">* Grouping Mapping - shows the mapping of aggregate and grouping column internal names to their expression form <br></td></tr>
            <tr><td class="diff-unchanged" >* Query - the source query <br>* Model Name - the model name <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>When integrating information using a federated query planner it is useful to view the query plans to better understand how information is being accessed and processed, and to troubleshoot problems.</p>

<p>A query plan (also known as an execution or processing plan) is a set of instructions created by a query engine for executing a command submitted by a user or application. The purpose of the query plan is to execute the user's query in as efficient a way as possible.</p>

<h1><a name="QueryPlans-GettingaQueryPlan"></a>Getting a Query Plan</h1>

<p>You can get a query plan any time you execute a command. The SQL options available are as follows:</p>

<p><b>SET SHOWPLAN [ON&#124;DEBUG]</b>&#45; Returns the processing plan or the plan and the full planner <a href="/author/display/TEIID/Query+Planner" title="Query Planner">Debug Log</a>.  See also the <a href="/author/display/TEIID/SET+Statement" title="SET Statement">SET Statement</a>.</p>

<p>With the above options, the query plan is available from the Statement object by casting to the <tt>org.teiid.jdbc.TeiidStatement</tt> interface or by using the "SHOW PLAN" <a href="/author/display/TEIID/SHOW+Statement" title="SHOW Statement">statement</a>.</p>

<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Retrieving a Query Plan</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: sql; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
statement.execute("set showplan on");
ResultSet rs = statement.executeQuery("select ...");
TeiidStatement tstatement = statement.unwrap(TeiidStatement.class);
PlanNode queryPlan = tstatement.getPlanDescription();
System.out.println(queryPlan);
</pre>
</div></div>

<p>The query plan is made available automatically in several of Teiid's tools.</p>

<h1><a name="QueryPlans-AnalyzingaQueryPlan"></a>Analyzing a Query Plan</h1>

<p>Once a query plan has been obtained you will most commonly be looking for:</p>

<ul>
        <li>Source pushdown &#45;&#45; what parts of the query that got pushed to each source
        <ul>
                <li>Ensure that any predicates especially against indexes are pushed</li>
        </ul>
        </li>
</ul>


<ul>
        <li>Joins - as federated joins can be quite expensive
        <ul>
                <li>Join ordering - typically influenced by costing</li>
                <li>Join criteria type mismatches.</li>
                <li>Join algorithm used - merge, enhanced merge, nested loop, etc.</li>
        </ul>
        </li>
</ul>


<ul>
        <li>Presence of federated optimizations, such as dependent joins.</li>
</ul>


<ul>
        <li>Ensure hints have the desired affects - see <a href="/author/display/TEIID/Hints+and+Options" title="Hints and Options">Hints and Options</a>, hints in the <a href="/author/display/TEIID/FROM+Clause" title="FROM Clause">FROM Clause</a>, <a href="/author/display/TEIID/Subquery+Optimization" title="Subquery Optimization">Subquery Optimization</a>, and <a href="/author/display/TEIID/Federated+Optimizations" title="Federated Optimizations">Federated Optimizations</a>.</li>
</ul>


<p>All of the above information can be determined from the processing plan. You will typically be interested in analyzing the textual form of the final processing plan.  To understand why particular decisions are made for debugging or support you will want to obtain the full debug log which will contain the intermediate planning steps as well as annotations as to why specific pushdown decisions are made.  </p>

<p>A query plan consists of a set of nodes organized in a tree structure. If you are executing a procedure or generating an XML document from an XML Document Model, the overall query plan will contain additional information related the surrounding procedural execution.</p>

<p>In a procedural context the ordering of child nodes implies the order of execution. In most other situation, child nodes may be executed in any order even in parallel. Only in specific optimizations, such as dependent join, will the children of a join execute serially.</p>

<h1><a name="QueryPlans-RelationalQueryPlans"></a>Relational Query Plans</h1>

<p>Relational plans represent the processing plan that is composed of nodes representing building blocks of logical relational operations. Relational processing plans differ from logical debug relational plans in that they will contain additional operations and execution specifics that were chosen by the optimizer.</p>

<p>The nodes for a relational query plan are:</p>

<ul>
        <li>Access - Access a source. A source query is sent to the connection factory associated with the source. [For a dependent join, this node is called Dependent Access.]</li>
</ul>


<ul>
        <li>Dependent Procedure Access - Access a stored procedure on a source using multiple sets of input values.</li>
</ul>


<ul>
        <li>Batched Update - Processes a set of updates as a batch.</li>
</ul>


<ul>
        <li>Project - Defines the columns returned from the node. This does not alter the number of records returned.</li>
</ul>


<ul>
        <li>Project Into - Like a normal project, but outputs rows into a target table.</li>
</ul>


<ul>
        <li>Insert Plan Execution - Similar to a project into, but executes a plan rather than a source query.  Typically created when executing an insert into view with a query expression.</li>
</ul>


<ul>
        <li>Window Function Project - Like a normal project, but includes window functions.</li>
</ul>


<ul>
        <li>Select - Select is a criteria evaluation filter node (WHERE / HAVING).</li>
</ul>


<ul>
        <li>Join - Defines the join type, join criteria, and join strategy (merge or nested loop).</li>
</ul>


<ul>
        <li>Union All - There are no properties for this node, it just passes rows through from it's children.  Depending upon other factors, such as if there is a transaction or the source query concurrency allowed, not all of the union children will execute in parallel.</li>
</ul>


<ul>
        <li>Sort - Defines the columns to sort on, the sort direction for each column, and whether to remove duplicates or not.</li>
</ul>


<ul>
        <li>Dup Remove - Removes duplicate rows.  The processing uses a tree structure to detect duplicates so that results will effectively stream at the cost of IO operations.</li>
</ul>


<ul>
        <li>Grouping - Groups sets of rows into groups and evaluates aggregate functions.</li>
</ul>


<ul>
        <li>Null - A node that produces no rows. Usually replaces a Select node where the criteria is always false (and whatever tree is underneath). There are no properties for this node.</li>
</ul>


<ul>
        <li>Plan Execution - Executes another sub plan. Typically the sub plan will be a non-relational plan.</li>
</ul>


<ul>
        <li>Dependent Procedure Execution - Executes a sub plan using multiple sets of input values.</li>
</ul>


<ul>
        <li>Limit - Returns a specified number of rows, then stops processing. Also processes an offset if present.</li>
</ul>


<ul>
        <li>XML Table - Evaluates XMLTABLE. The debug plan will contain more information about the XQuery/XPath with regards to their optimization - see the XQuery section below or <a href="/author/display/TEIID/XQuery+Optimization" title="XQuery Optimization">XQuery Optimization</a>.</li>
</ul>


<ul>
        <li>Text Table - Evaluates TEXTTABLE</li>
</ul>


<ul>
        <li>Array Table - Evaluates ARRAYTABLE</li>
</ul>


<ul>
        <li>Object Table - Evaluates OBJECTTABLE</li>
</ul>


<h3><a name="QueryPlans-NodeStatistics"></a>Node Statistics</h3>

<p>Every node has a set of statistics that are output. These can be used to determine the amount of data flowing through the node.  Before execution a processor plan will not contain node statistics.  Also the statistics are updated as the plan is processed, so typically you'll want the final statistics after all rows have been processed by the client.</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Statistic </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Units </th>
</tr>
<tr>
<td class='confluenceTd'> Node Output Rows </td>
<td class='confluenceTd'> Number of records output from the node </td>
<td class='confluenceTd'> count </td>
</tr>
<tr>
<td class='confluenceTd'> Node Next Batch Process Time </td>
<td class='confluenceTd'> Time processing in this node only </td>
<td class='confluenceTd'> millisec </td>
</tr>
<tr>
<td class='confluenceTd'> Node Cumulative Next Batch Process Time </td>
<td class='confluenceTd'> Time processing in this node + child nodes </td>
<td class='confluenceTd'> millisec </td>
</tr>
<tr>
<td class='confluenceTd'> Node Cumulative Process Time </td>
<td class='confluenceTd'> Elapsed time from beginning of processing to end </td>
<td class='confluenceTd'> millisec </td>
</tr>
<tr>
<td class='confluenceTd'> Node Next Batch Calls </td>
<td class='confluenceTd'> Number of times a node was called for processing </td>
<td class='confluenceTd'> count </td>
</tr>
<tr>
<td class='confluenceTd'> Node Blocks </td>
<td class='confluenceTd'> Number of times a blocked exception was thrown by this node or a child </td>
<td class='confluenceTd'> count </td>
</tr>
</tbody></table>
</div>


<p>In addition to node statistics, some nodes display cost estimates computed at the node.</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Cost Estimates </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Units </th>
</tr>
<tr>
<td class='confluenceTd'> Estimated Node Cardinality </td>
<td class='confluenceTd'> Estimated number of records that will be output from the node; &#45;1 if unknown </td>
<td class='confluenceTd'> count </td>
</tr>
</tbody></table>
</div>


<p>The root node will display additional information.</p>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Top level Statistics </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Units </th>
</tr>
<tr>
<td class='confluenceTd'> Data Bytes Sent </td>
<td class='confluenceTd'> The size of the serialized data result (row and lob values) sent to the client </td>
<td class='confluenceTd'> bytes </td>
</tr>
</tbody></table>
</div>


<h3><a name="QueryPlans-ReadingaProcessorPlan"></a>Reading a Processor Plan</h3>

<p>The query processor plan can be obtained in a plain text or xml format.  The plan text format is typically easier to read, while the xml format is easier to process by tooling.  When possible tooling should be used to examine the plans as the tree structures can be deeply nested.  </p>

<p>Data flows from the leafs of the tree to the root.  Sub plans for procedure execution can be shown inline, and are differentiated by different indentation.  Given a user query of "SELECT pm1.g1.e1, pm1.g2.e2, pm1.g3.e3 from pm1.g1 inner join (pm1.g2 left outer join pm1.g3 on pm1.g2.e1=pm1.g3.e1) on pm1.g1.e1=pm1.g3.e1" the text for a processor plan that does not push down the joins would look like:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
ProjectNode
  + Output Columns:
    0: e1 (string)
    1: e2 (integer)
    2: e3 (boolean)
  + Cost Estimates:Estimated Node Cardinality: -1.0
  + Child 0:
    JoinNode
      + Output Columns:
        0: e1 (string)
        1: e2 (integer)
        2: e3 (boolean)
      + Cost Estimates:Estimated Node Cardinality: -1.0
      + Child 0:
        JoinNode
          + Output Columns:
            0: e1 (string)
            1: e1 (string)
            2: e3 (boolean)
          + Cost Estimates:Estimated Node Cardinality: -1.0
          + Child 0:
            AccessNode
              + Output Columns:e1 (string)
              + Cost Estimates:Estimated Node Cardinality: -1.0
              + Query:SELECT g_0.e1 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0
              + Model Name:pm1
          + Child 1:
            AccessNode
              + Output Columns:
                0: e1 (string)
                1: e3 (boolean)
              + Cost Estimates:Estimated Node Cardinality: -1.0
              + Query:SELECT g_0.e1 AS c_0, g_0.e3 AS c_1 FROM pm1.g3 AS g_0 ORDER BY c_0
              + Model Name:pm1
          + Join Strategy:MERGE JOIN (ALREADY_SORTED/ALREADY_SORTED)
          + Join Type:INNER JOIN
          + Join Criteria:pm1.g1.e1=pm1.g3.e1
      + Child 1:
        AccessNode
          + Output Columns:
            0: e1 (string)
            1: e2 (integer)
          + Cost Estimates:Estimated Node Cardinality: -1.0
          + Query:SELECT g_0.e1 AS c_0, g_0.e2 AS c_1 FROM pm1.g2 AS g_0 ORDER BY c_0
          + Model Name:pm1
      + Join Strategy:ENHANCED SORT JOIN (SORT/ALREADY_SORTED)
      + Join Type:INNER JOIN
      + Join Criteria:pm1.g3.e1=pm1.g2.e1
  + Select Columns:
    0: pm1.g1.e1
    1: pm1.g2.e2
    2: pm1.g3.e3
</pre>
</div></div>

<p>Note that the nested join node is using a merge join and expects the source queries from each side to produce the expected ordering for the join.  The parent join is an enhanced sort join which can delay the decision to perform sorting based upon the incoming rows. Note that the outer join from the user query has been modified to an inner join since none of the null inner values can be present in the query result.</p>

<p>The same plan in xml form looks like:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;node name="ProjectNode"&gt;
        &lt;property name="Output Columns"&gt;
                &lt;value&gt;e1 (string)&lt;/value&gt;
                &lt;value&gt;e2 (integer)&lt;/value&gt;
                &lt;value&gt;e3 (boolean)&lt;/value&gt;
        &lt;/property&gt;
        &lt;property name="Cost Estimates"&gt;
                &lt;value&gt;Estimated Node Cardinality: -1.0&lt;/value&gt;
        &lt;/property&gt;
        &lt;property name="Child 0"&gt;
                &lt;node name="JoinNode"&gt;
                        &lt;property name="Output Columns"&gt;
                                &lt;value&gt;e1 (string)&lt;/value&gt;
                                &lt;value&gt;e2 (integer)&lt;/value&gt;
                                &lt;value&gt;e3 (boolean)&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name="Cost Estimates"&gt;
                                &lt;value&gt;Estimated Node Cardinality: -1.0&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name="Child 0"&gt;
                                &lt;node name="JoinNode"&gt;
                                        &lt;property name="Output Columns"&gt;
                                                &lt;value&gt;e1 (string)&lt;/value&gt;
                                                &lt;value&gt;e1 (string)&lt;/value&gt;
                                                &lt;value&gt;e3 (boolean)&lt;/value&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Cost Estimates"&gt;
                                                &lt;value&gt;Estimated Node Cardinality: -1.0&lt;/value&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Child 0"&gt;
                                                &lt;node name="AccessNode"&gt;
                                                        &lt;property name="Output Columns"&gt;
                                                                &lt;value&gt;e1 (string)&lt;/value&gt;
                                                        &lt;/property&gt;
                                                        &lt;property name="Cost Estimates"&gt;
                                                                &lt;value&gt;Estimated Node Cardinality: -1.0&lt;/value&gt;
                                                        &lt;/property&gt;
                                                        &lt;property name="Query"&gt;
                                                                &lt;value&gt;SELECT g_0.e1 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0&lt;/value&gt;
                                                        &lt;/property&gt;
                                                        &lt;property name="Model Name"&gt;
                                                                &lt;value&gt;pm1&lt;/value&gt;
                                                        &lt;/property&gt;
                                                &lt;/node&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Child 1"&gt;
                                                &lt;node name="AccessNode"&gt;
                                                        &lt;property name="Output Columns"&gt;
                                                                &lt;value&gt;e1 (string)&lt;/value&gt;
                                                                &lt;value&gt;e3 (boolean)&lt;/value&gt;
                                                        &lt;/property&gt;
                                                        &lt;property name="Cost Estimates"&gt;
                                                                &lt;value&gt;Estimated Node Cardinality: -1.0&lt;/value&gt;
                                                        &lt;/property&gt;
                                                        &lt;property name="Query"&gt;
                                                                &lt;value&gt;SELECT g_0.e1 AS c_0, g_0.e3 AS c_1 FROM pm1.g3 AS g_0
                                                                        ORDER BY c_0&lt;/value&gt;
                                                        &lt;/property&gt;
                                                        &lt;property name="Model Name"&gt;
                                                                &lt;value&gt;pm1&lt;/value&gt;
                                                        &lt;/property&gt;
                                                &lt;/node&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Join Strategy"&gt;
                                                &lt;value&gt;MERGE JOIN (ALREADY_SORTED/ALREADY_SORTED)&lt;/value&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Join Type"&gt;
                                                &lt;value&gt;INNER JOIN&lt;/value&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Join Criteria"&gt;
                                                &lt;value&gt;pm1.g1.e1=pm1.g3.e1&lt;/value&gt;
                                        &lt;/property&gt;
                                &lt;/node&gt;
                        &lt;/property&gt;
                        &lt;property name="Child 1"&gt;
                                &lt;node name="AccessNode"&gt;
                                        &lt;property name="Output Columns"&gt;
                                                &lt;value&gt;e1 (string)&lt;/value&gt;
                                                &lt;value&gt;e2 (integer)&lt;/value&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Cost Estimates"&gt;
                                                &lt;value&gt;Estimated Node Cardinality: -1.0&lt;/value&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Query"&gt;
                                                &lt;value&gt;SELECT g_0.e1 AS c_0, g_0.e2 AS c_1 FROM pm1.g2 AS g_0
                                                        ORDER BY c_0&lt;/value&gt;
                                        &lt;/property&gt;
                                        &lt;property name="Model Name"&gt;
                                                &lt;value&gt;pm1&lt;/value&gt;
                                        &lt;/property&gt;
                                &lt;/node&gt;
                        &lt;/property&gt;
                        &lt;property name="Join Strategy"&gt;
                                &lt;value&gt;ENHANCED SORT JOIN (SORT/ALREADY_SORTED)&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name="Join Type"&gt;
                                &lt;value&gt;INNER JOIN&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name="Join Criteria"&gt;
                                &lt;value&gt;pm1.g3.e1=pm1.g2.e1&lt;/value&gt;
                        &lt;/property&gt;
                &lt;/node&gt;
        &lt;/property&gt;
        &lt;property name="Select Columns"&gt;
                &lt;value&gt;pm1.g1.e1&lt;/value&gt;
                &lt;value&gt;pm1.g2.e2&lt;/value&gt;
                &lt;value&gt;pm1.g3.e3&lt;/value&gt;
        &lt;/property&gt;
&lt;/node&gt;
</pre>
</div></div>

<p>Note that the same information appears in each of the plan forms.  In some cases it can actually be easier to follow the simplified format of the debug plan final processor plan.  From the <a href="/author/display/TEIID/Query+Planner" title="Query Planner">Debug Log</a> the same plan as above would appear as:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
OPTIMIZATION COMPLETE:
PROCESSOR PLAN:
ProjectNode(0) output=[pm1.g1.e1, pm1.g2.e2, pm1.g3.e3] [pm1.g1.e1, pm1.g2.e2, pm1.g3.e3]
  JoinNode(1) [ENHANCED SORT JOIN (SORT/ALREADY_SORTED)] [INNER JOIN] criteria=[pm1.g3.e1=pm1.g2.e1] output=[pm1.g1.e1, pm1.g2.e2, pm1.g3.e3]
    JoinNode(2) [MERGE JOIN (ALREADY_SORTED/ALREADY_SORTED)] [INNER JOIN] criteria=[pm1.g1.e1=pm1.g3.e1] output=[pm1.g3.e1, pm1.g1.e1, pm1.g3.e3]
      AccessNode(3) output=[pm1.g1.e1] SELECT g_0.e1 AS c_0 FROM pm1.g1 AS g_0 ORDER BY c_0
      AccessNode(4) output=[pm1.g3.e1, pm1.g3.e3] SELECT g_0.e1 AS c_0, g_0.e3 AS c_1 FROM pm1.g3 AS g_0 ORDER BY c_0
    AccessNode(5) output=[pm1.g2.e1, pm1.g2.e2] SELECT g_0.e1 AS c_0, g_0.e2 AS c_1 FROM pm1.g2 AS g_0 ORDER BY c_0
</pre>
</div></div>

<h3><a name="QueryPlans-NodeProperties"></a>Node Properties</h3>

<h5><a name="QueryPlans-Common"></a>Common</h5>

<ul>
        <li>Output Columns - what columns make up the tuples returned by this node</li>
        <li>Data Bytes Sent - how many data byte, not including messaging overhead, were sent by this query</li>
        <li>Planning Time - the amount of time in milliseconds spent planning the query</li>
</ul>


<h5><a name="QueryPlans-Relational"></a>Relational</h5>

<ul>
        <li>Relational Node ID - matches the node ids seen in the debug log Node(id)</li>
        <li>Criteria - the boolean expression used for filtering</li>
        <li>Select Columns - the columns that define the projection</li>
        <li>Grouping Columns - the columns used for grouping</li>
        <li>Grouping Mapping - shows the mapping of aggregate and grouping column internal names to their expression form</li>
        <li>Query - the source query</li>
        <li>Model Name - the model name</li>
        <li>Sharing ID - nodes sharing the same source results will have the same sharing id</li>
        <li>Dependent Join - if a dependent join is being used</li>
        <li>Join Strategy - the join strategy (Nested Loop, Sort Merge, Enhanced Sort, etc.)</li>
        <li>Join Type - the join type (Left Outer Join, Inner Join, Cross Join)</li>
        <li>Join Criteria - the join predicates</li>
        <li>Execution Plan - the nested execution plan</li>
        <li>Into Target - the insertion target</li>
        <li>Sort Columns - the columns for sorting</li>
        <li>Sort Mode - if the sort performs another function as well, such as distinct removal</li>
        <li>Rollup - if the group by has the rollup option</li>
        <li>Statistics - the processing statistics</li>
        <li>Cost Estimates - the cost/cardinality estimates including dependent join cost estimates</li>
        <li>Row Offset - the row offset expression</li>
        <li>Row Limit - the row limit expression</li>
        <li>With - the with clause</li>
        <li>Window Functions - the window functions being computed</li>
        <li>Table Function - the table function (XMLTABLE, OBJECTTABLE, TEXTTABLE, etc.)</li>
</ul>


<h5><a name="QueryPlans-XML"></a>XML</h5>

<ul>
        <li>Message</li>
        <li>Tag</li>
        <li>Namespace</li>
        <li>Data Column</li>
        <li>Namespace Declarations</li>
        <li>Optional Flag</li>
        <li>Default Value</li>
        <li>Recursion Direction</li>
        <li>Bindings</li>
        <li>Is Staging Flag</li>
        <li>Source In Memory Flag</li>
        <li>Condition</li>
        <li>Default Program</li>
        <li>Encoding</li>
        <li>Formatted Flag</li>
</ul>


<h5><a name="QueryPlans-Procedure"></a>Procedure</h5>

<ul>
        <li>Expression</li>
        <li>Result Set</li>
        <li>Program</li>
        <li>Variable</li>
        <li>Then</li>
        <li>Else</li>
</ul>


<h1><a name="QueryPlans-OtherPlans"></a>Other Plans</h1>

<p>XML document model queries and procedure execution (including instead of triggers) use intermediate and final plan forms that include relational plans.  Generally the structure of the xml/procedure plans will closely match their logical forms.  It's the nested relational plans that will be of interest when analyzing performance issues.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/Query+Plans">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646297&revisedVersion=25&originalVersion=24">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Query+Plans?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>