<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/Dependent+Join+Pushdown">Dependent Join Pushdown</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (7)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">Dependent joins are a technique used in federation to reduce the cost of cross source joins.  Join values from one side of a join are made available to the other side which reduces the number of tuples needed to preform the join.  Translators may indicate support for dependent join pushdown via the supportsDependentJoin capability.  The handling of pushdown dependent join queries can be quite complicated.  The ordering \(if present) and all of the non\-dependent criteria constructs on the pushdown command must be honored, but if needed the dependent criteria, which will be a {{Comparison}} with a {{Parameter}}, may be ignored in part or in total.  Pushdown dependent join queries will be instances of {{Select}} with the relevant dependent sets available via {{Select.getDependentSets\()}}.  The dependent set is associated to Parameters by id via the {{Parameter.getDepenentValueId\()}} identifier.  The dependent set tuple iterators provide rows that are referenced by the column positions \(available via {{Parameter.getValueIndex\()}}) on the dependent join Comparison criteria right expression.  Care should be taken with the tuple values as they may guareenteed to be unique or ordered.   <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Dependent joins are a technique used in federation to reduce the cost of cross source joins.  Join values from one side of a join are made available to the other side which reduces the number of tuples needed to preform the join.  Translators may indicate support for dependent join pushdown via the supportsDependentJoin and supportsFullDependentJoin capabilities.  The handling of pushdown dependent join queries can be complicated. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{note}There is no reference implementation of this functionality as all built\-in translators rely on the engine to handle breaking up dependent joins into simplier queries. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">{note}See the JDBC Translator for the reference implementation of dependent join pushdown handling based up the creation temporary tables.{note} <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2. Key Pushdown <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">{note}</span> <span class="diff-added-words"style="background-color: #dfd;"> </span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">The more simplistic mode of dependent join pushdown is to push only the key (equi-join) values to effectively evaluate a semi-join - the full join will still be processed by the engine after the retrieval.  The ordering \(if present) and all of the non\-dependent criteria constructs on the pushdown command *must* be honored.  The dependent criteria, which will be a {{Comparison}} with a {{Parameter}} \(possibly in {{Array}} form), may be ignored in part or in total to retrieve a superset of the tuples requested.   <br> <br>Pushdown key dependent join queries will be instances of {{Select}} with the relevant dependent values available via {{Select.getDependentValues\()}}.  A dependent value tuple list is associated to Parameters by id via the {{Parameter.getDepenentValueId\()}} identifier.  The dependent tuple list provide rows that are referenced by the column positions \(available via {{Parameter.getValueIndex\()}}).  Care should be taken with the tuple values as they may guaranteed to be ordered, but will be unique with respect to all of the {{Parameter}} references against the given dependent value tuple list. <br> <br>h2. Full Pushdown <br> <br>In some scenarios, typically with small independent data sets or extensive processing above the join that can be pushed to the source, it is advantageous for the source to handle the dependent join pushdown.  This feature is marked as supported by the supportsFullDepedentJoin capability.  Here the source is expected to process the command exactly as specified - the dependent join is not optional <br> <br>Full pushdown dependent join queries will be instances of {{QueryExpression}} with the relevant dependent values available via special common table definitions using {{QueryExpression.getWith\()}}.  The independent side of a full pushdown join will appear as a common table {{WithItem}} with a dependent value tuple list available via {{WithItem.getDependentValues\()}}.  The dependent value tuples will positionally match the columns defined by {{WithItem.getColumns\()}}. The dependent value tuple list is not guaranteed to be in any particular order. <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>Dependent joins are a technique used in federation to reduce the cost of cross source joins.  Join values from one side of a join are made available to the other side which reduces the number of tuples needed to preform the join.  Translators may indicate support for dependent join pushdown via the supportsDependentJoin and supportsFullDependentJoin capabilities.  The handling of pushdown dependent join queries can be complicated.</p>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>See the JDBC Translator for the reference implementation of dependent join pushdown handling based up the creation temporary tables.</td></tr></table></div>

<h2><a name="DependentJoinPushdown-KeyPushdown"></a>Key Pushdown</h2>

<p>The more simplistic mode of dependent join pushdown is to push only the key (equi-join) values to effectively evaluate a semi-join - the full join will still be processed by the engine after the retrieval.  The ordering &#40;if present) and all of the non&#45;dependent criteria constructs on the pushdown command <b>must</b> be honored.  The dependent criteria, which will be a <tt>Comparison</tt> with a <tt>Parameter</tt> &#40;possibly in <tt>Array</tt> form), may be ignored in part or in total to retrieve a superset of the tuples requested.  </p>

<p>Pushdown key dependent join queries will be instances of <tt>Select</tt> with the relevant dependent values available via <tt>Select.getDependentValues&#40;)</tt>.  A dependent value tuple list is associated to Parameters by id via the <tt>Parameter.getDepenentValueId&#40;)</tt> identifier.  The dependent tuple list provide rows that are referenced by the column positions &#40;available via <tt>Parameter.getValueIndex&#40;)</tt>).  Care should be taken with the tuple values as they may guaranteed to be ordered, but will be unique with respect to all of the <tt>Parameter</tt> references against the given dependent value tuple list.</p>

<h2><a name="DependentJoinPushdown-FullPushdown"></a>Full Pushdown</h2>

<p>In some scenarios, typically with small independent data sets or extensive processing above the join that can be pushed to the source, it is advantageous for the source to handle the dependent join pushdown.  This feature is marked as supported by the supportsFullDepedentJoin capability.  Here the source is expected to process the command exactly as specified - the dependent join is not optional</p>

<p>Full pushdown dependent join queries will be instances of <tt>QueryExpression</tt> with the relevant dependent values available via special common table definitions using <tt>QueryExpression.getWith&#40;)</tt>.  The independent side of a full pushdown join will appear as a common table <tt>WithItem</tt> with a dependent value tuple list available via <tt>WithItem.getDependentValues&#40;)</tt>.  The dependent value tuples will positionally match the columns defined by <tt>WithItem.getColumns&#40;)</tt>. The dependent value tuple list is not guaranteed to be in any particular order.</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/Dependent+Join+Pushdown">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646171&revisedVersion=2&originalVersion=1">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Dependent+Join+Pushdown?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>