blob: 1e96707119694f2dde64e3b6a29bed0c93e464d1 [file] [log] [blame]
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>LoptSemiJoinOptimizer (Apache Calcite API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="LoptSemiJoinOptimizer (Apache Calcite API)";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/LoptSemiJoinOptimizer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">org.apache.calcite.rel.rules</a></div>
<h2 title="Class LoptSemiJoinOptimizer" class="title">Class LoptSemiJoinOptimizer</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.apache.calcite.rel.rules.LoptSemiJoinOptimizer</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<pre>public class <span class="typeNameLabel">LoptSemiJoinOptimizer</span>
extends java.lang.Object</pre>
<div class="block">Implements the logic for determining the optimal
semi-joins to be used in processing joins in a query.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="LoptSemiJoinOptimizer.FactorCostComparator.html" title="class in org.apache.calcite.rel.rules">LoptSemiJoinOptimizer.FactorCostComparator</a></span></code></th>
<td class="colLast">
<div class="block">Compares factors.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="LoptSemiJoinOptimizer.FemLocalIndex.html" title="class in org.apache.calcite.rel.rules">LoptSemiJoinOptimizer.FemLocalIndex</a></span></code></th>
<td class="colLast">
<div class="block">Dummy class to allow code to compile.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="LoptSemiJoinOptimizer.LcsIndexOptimizer.html" title="class in org.apache.calcite.rel.rules">LoptSemiJoinOptimizer.LcsIndexOptimizer</a></span></code></th>
<td class="colLast">
<div class="block">Dummy class to allow code to compile.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="LoptSemiJoinOptimizer.LcsTable.html" title="class in org.apache.calcite.rel.rules">LoptSemiJoinOptimizer.LcsTable</a></span></code></th>
<td class="colLast">
<div class="block">Dummy class to allow code to compile.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="LoptSemiJoinOptimizer.LcsTableScan.html" title="class in org.apache.calcite.rel.rules">LoptSemiJoinOptimizer.LcsTableScan</a></span></code></th>
<td class="colLast">
<div class="block">Dummy class to allow code to compile.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="LoptSemiJoinOptimizer.LucidDbSpecialOperators.html" title="class in org.apache.calcite.rel.rules">LoptSemiJoinOptimizer.LucidDbSpecialOperators</a></span></code></th>
<td class="colLast">
<div class="block">Dummy class to allow code to compile.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- =========== FIELD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#chosenSemiJoins">chosenSemiJoins</a></span></code></th>
<td class="colLast">
<div class="block">Semijoins corresponding to each join factor, if they are going to be
filtered by semijoins.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private com.google.common.collect.Ordering&lt;java.lang.Integer&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#factorCostOrdering">factorCostOrdering</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../metadata/RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#mq">mq</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private java.util.Map&lt;java.lang.Integer,&#8203;java.util.Map&lt;java.lang.Integer,&#8203;<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&gt;&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#possibleSemiJoins">possibleSemiJoins</a></span></code></th>
<td class="colLast">
<div class="block">Associates potential semijoins with each fact table factor.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../rex/RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#rexBuilder">rexBuilder</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#THRESHOLD_SCORE">THRESHOLD_SCORE</a></span></code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="#%3Cinit%3E(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.rules.LoptMultiJoin,org.apache.calcite.rex.RexBuilder)">LoptSemiJoinOptimizer</a></span>&#8203;(<a href="../metadata/RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
<a href="../../rex/RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
</section>
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>private <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#adjustSemiJoinCondition(org.apache.calcite.rel.rules.LoptMultiJoin,int,org.apache.calcite.rex.RexNode,int,int)">adjustSemiJoinCondition</a></span>&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
int&nbsp;leftAdjustment,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;semiJoinCondition,
int&nbsp;leftIdx,
int&nbsp;rightIdx)</code></th>
<td class="colLast">
<div class="block">Modifies the semijoin condition to reflect the fact that the RHS is now
the second factor into a join and the LHS is the first</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#chooseBestSemiJoin(org.apache.calcite.rel.rules.LoptMultiJoin)">chooseBestSemiJoin</a></span>&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin)</code></th>
<td class="colLast">
<div class="block">Finds the optimal semijoin for filtering the least costly fact table from
among the remaining possible semijoins to choose from.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>private double</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#computeScore(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.logical.LogicalJoin)">computeScore</a></span>&#8203;(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;factRel,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;dimRel,
<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&nbsp;semiJoin)</code></th>
<td class="colLast">
<div class="block">Computes a score relevant to applying a set of semijoins on a fact table.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>private <a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#findSemiJoinIndexByCost(org.apache.calcite.rel.rules.LoptMultiJoin,java.util.List,int,int)">findSemiJoinIndexByCost</a></span>&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
java.util.List&lt;<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;joinFilters,
int&nbsp;factIdx,
int&nbsp;dimIdx)</code></th>
<td class="colLast">
<div class="block">Given a list of possible filters on a fact table, determine if there is
an index that can be used, provided all the fact table keys originate
from the same underlying table.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getChosenSemiJoin(int)">getChosenSemiJoin</a></span>&#8203;(int&nbsp;factIdx)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>private int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSuitableFilter(org.apache.calcite.rel.rules.LoptMultiJoin,org.apache.calcite.rex.RexNode,int)">isSuitableFilter</a></span>&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;joinFilter,
int&nbsp;factIdx)</code></th>
<td class="colLast">
<div class="block">Determines if a join filter can be used with a semijoin against a
specified fact table.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#makePossibleSemiJoins(org.apache.calcite.rel.rules.LoptMultiJoin)">makePossibleSemiJoins</a></span>&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin)</code></th>
<td class="colLast">
<div class="block">Determines all possible semijoins that can be used by dimension tables to
filter fact tables.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>private <a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeExtraFilters(java.util.List,int,org.apache.calcite.rex.RexNode)">removeExtraFilters</a></span>&#8203;(java.util.List&lt;java.lang.Integer&gt;&nbsp;keys,
int&nbsp;nFields,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition)</code></th>
<td class="colLast">
<div class="block">Removes from an expression any sub-expressions that reference key values
that aren't contained in a key list passed in.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>private void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removeJoin(org.apache.calcite.rel.rules.LoptMultiJoin,org.apache.calcite.rel.logical.LogicalJoin,int,int)">removeJoin</a></span>&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&nbsp;semiJoin,
int&nbsp;factIdx,
int&nbsp;dimIdx)</code></th>
<td class="colLast">
<div class="block">Determines whether a join of the dimension table in a semijoin can be
removed.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>private void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#removePossibleSemiJoin(java.util.Map,java.lang.Integer,java.lang.Integer)">removePossibleSemiJoin</a></span>&#8203;(java.util.Map&lt;java.lang.Integer,&#8203;<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&gt;&nbsp;possibleDimensions,
java.lang.Integer&nbsp;factIdx,
java.lang.Integer&nbsp;dimIdx)</code></th>
<td class="colLast">
<div class="block">Removes a dimension table from a fact table's list of possible semijoins</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>private <a href="LoptSemiJoinOptimizer.LcsTable.html" title="class in org.apache.calcite.rel.rules">LoptSemiJoinOptimizer.LcsTable</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#validateKeys(org.apache.calcite.rel.RelNode,java.util.List,java.util.List,java.util.List)">validateKeys</a></span>&#8203;(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;factRel,
java.util.List&lt;java.lang.Integer&gt;&nbsp;leftKeys,
java.util.List&lt;java.lang.Integer&gt;&nbsp;rightKeys,
java.util.List&lt;java.lang.Integer&gt;&nbsp;actualLeftKeys)</code></th>
<td class="colLast">
<div class="block">Validates the candidate semijoin keys corresponding to the fact table.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a id="THRESHOLD_SCORE">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>THRESHOLD_SCORE</h4>
<pre>private static final&nbsp;int THRESHOLD_SCORE</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../../constant-values.html#org.apache.calcite.rel.rules.LoptSemiJoinOptimizer.THRESHOLD_SCORE">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a id="rexBuilder">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rexBuilder</h4>
<pre>private final&nbsp;<a href="../../rex/RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a> rexBuilder</pre>
</li>
</ul>
<a id="mq">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>mq</h4>
<pre>private final&nbsp;<a href="../metadata/RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a> mq</pre>
</li>
</ul>
<a id="chosenSemiJoins">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chosenSemiJoins</h4>
<pre>private&nbsp;<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>[] chosenSemiJoins</pre>
<div class="block">Semijoins corresponding to each join factor, if they are going to be
filtered by semijoins. Otherwise, the entry is the original join factor.</div>
</li>
</ul>
<a id="possibleSemiJoins">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>possibleSemiJoins</h4>
<pre>private&nbsp;java.util.Map&lt;java.lang.Integer,&#8203;java.util.Map&lt;java.lang.Integer,&#8203;<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&gt;&gt; possibleSemiJoins</pre>
<div class="block">Associates potential semijoins with each fact table factor. The first
parameter in the map corresponds to the fact table. The second
corresponds to the dimension table and a SemiJoin that captures all
the necessary semijoin data between that fact and dimension table</div>
</li>
</ul>
<a id="factorCostOrdering">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>factorCostOrdering</h4>
<pre>private final&nbsp;com.google.common.collect.Ordering&lt;java.lang.Integer&gt; factorCostOrdering</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a id="&lt;init&gt;(org.apache.calcite.rel.metadata.RelMetadataQuery,org.apache.calcite.rel.rules.LoptMultiJoin,org.apache.calcite.rex.RexBuilder)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>LoptSemiJoinOptimizer</h4>
<pre>public&nbsp;LoptSemiJoinOptimizer&#8203;(<a href="../metadata/RelMetadataQuery.html" title="class in org.apache.calcite.rel.metadata">RelMetadataQuery</a>&nbsp;mq,
<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
<a href="../../rex/RexBuilder.html" title="class in org.apache.calcite.rex">RexBuilder</a>&nbsp;rexBuilder)</pre>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="makePossibleSemiJoins(org.apache.calcite.rel.rules.LoptMultiJoin)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>makePossibleSemiJoins</h4>
<pre class="methodSignature">public&nbsp;void&nbsp;makePossibleSemiJoins&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin)</pre>
<div class="block">Determines all possible semijoins that can be used by dimension tables to
filter fact tables. Constructs SemiJoinRels corresponding to potential
dimension table filters and stores them in the member field
"possibleSemiJoins"</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>multiJoin</code> - join factors being optimized</dd>
</dl>
</li>
</ul>
<a id="isSuitableFilter(org.apache.calcite.rel.rules.LoptMultiJoin,org.apache.calcite.rex.RexNode,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSuitableFilter</h4>
<pre class="methodSignature">private&nbsp;int&nbsp;isSuitableFilter&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;joinFilter,
int&nbsp;factIdx)</pre>
<div class="block">Determines if a join filter can be used with a semijoin against a
specified fact table. A suitable filter is of the form "factable.col1 =
dimTable.col2".</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>multiJoin</code> - join factors being optimized</dd>
<dd><code>joinFilter</code> - filter to be analyzed</dd>
<dd><code>factIdx</code> - index corresponding to the fact table</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>index of corresponding dimension table if the filter is
appropriate; otherwise -1 is returned</dd>
</dl>
</li>
</ul>
<a id="findSemiJoinIndexByCost(org.apache.calcite.rel.rules.LoptMultiJoin,java.util.List,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>findSemiJoinIndexByCost</h4>
<pre class="methodSignature">private&nbsp;<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&nbsp;findSemiJoinIndexByCost&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
java.util.List&lt;<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&gt;&nbsp;joinFilters,
int&nbsp;factIdx,
int&nbsp;dimIdx)</pre>
<div class="block">Given a list of possible filters on a fact table, determine if there is
an index that can be used, provided all the fact table keys originate
from the same underlying table.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>multiJoin</code> - join factors being optimized</dd>
<dd><code>joinFilters</code> - filters to be used on the fact table</dd>
<dd><code>factIdx</code> - index in join factors corresponding to the fact table</dd>
<dd><code>dimIdx</code> - index in join factors corresponding to the dimension table</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>SemiJoin containing information regarding the semijoin that
can be used to filter the fact table</dd>
</dl>
</li>
</ul>
<a id="adjustSemiJoinCondition(org.apache.calcite.rel.rules.LoptMultiJoin,int,org.apache.calcite.rex.RexNode,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>adjustSemiJoinCondition</h4>
<pre class="methodSignature">private&nbsp;<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;adjustSemiJoinCondition&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
int&nbsp;leftAdjustment,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;semiJoinCondition,
int&nbsp;leftIdx,
int&nbsp;rightIdx)</pre>
<div class="block">Modifies the semijoin condition to reflect the fact that the RHS is now
the second factor into a join and the LHS is the first</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>multiJoin</code> - join factors being optimized</dd>
<dd><code>leftAdjustment</code> - amount the left RexInputRefs need to be adjusted by</dd>
<dd><code>semiJoinCondition</code> - condition to be adjusted</dd>
<dd><code>leftIdx</code> - index of the join factor corresponding to the LHS of the
semijoin,</dd>
<dd><code>rightIdx</code> - index of the join factor corresponding to the RHS of the
semijoin</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>modified semijoin condition</dd>
</dl>
</li>
</ul>
<a id="validateKeys(org.apache.calcite.rel.RelNode,java.util.List,java.util.List,java.util.List)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>validateKeys</h4>
<pre class="methodSignature">private&nbsp;<a href="LoptSemiJoinOptimizer.LcsTable.html" title="class in org.apache.calcite.rel.rules">LoptSemiJoinOptimizer.LcsTable</a>&nbsp;validateKeys&#8203;(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;factRel,
java.util.List&lt;java.lang.Integer&gt;&nbsp;leftKeys,
java.util.List&lt;java.lang.Integer&gt;&nbsp;rightKeys,
java.util.List&lt;java.lang.Integer&gt;&nbsp;actualLeftKeys)</pre>
<div class="block">Validates the candidate semijoin keys corresponding to the fact table.
Ensure the keys all originate from the same underlying table, and they
all correspond to simple column references. If unsuitable keys are found,
they're removed from the key list and a new list corresponding to the
remaining valid keys is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>factRel</code> - fact table RelNode</dd>
<dd><code>leftKeys</code> - fact table semijoin keys</dd>
<dd><code>rightKeys</code> - dimension table semijoin keys</dd>
<dd><code>actualLeftKeys</code> - the remaining valid fact table semijoin keys</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the underlying fact table if the semijoin keys are valid;
otherwise null</dd>
</dl>
</li>
</ul>
<a id="removeExtraFilters(java.util.List,int,org.apache.calcite.rex.RexNode)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeExtraFilters</h4>
<pre class="methodSignature">private&nbsp;<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;removeExtraFilters&#8203;(java.util.List&lt;java.lang.Integer&gt;&nbsp;keys,
int&nbsp;nFields,
<a href="../../rex/RexNode.html" title="class in org.apache.calcite.rex">RexNode</a>&nbsp;condition)</pre>
<div class="block">Removes from an expression any sub-expressions that reference key values
that aren't contained in a key list passed in. The keys represent join
keys on one side of a join. The subexpressions are all assumed to be of
the form "tab1.col1 = tab2.col2".</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>keys</code> - join keys from one side of the join</dd>
<dd><code>nFields</code> - number of fields in the side of the join for which the
keys correspond</dd>
<dd><code>condition</code> - original expression</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>modified expression with filters that don't reference specified
keys removed</dd>
</dl>
</li>
</ul>
<a id="chooseBestSemiJoin(org.apache.calcite.rel.rules.LoptMultiJoin)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chooseBestSemiJoin</h4>
<pre class="methodSignature">public&nbsp;boolean&nbsp;chooseBestSemiJoin&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin)</pre>
<div class="block">Finds the optimal semijoin for filtering the least costly fact table from
among the remaining possible semijoins to choose from. The chosen
semijoin is stored in the chosenSemiJoins array</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>multiJoin</code> - join factors being optimized</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if a suitable semijoin is found; false otherwise</dd>
</dl>
</li>
</ul>
<a id="computeScore(org.apache.calcite.rel.RelNode,org.apache.calcite.rel.RelNode,org.apache.calcite.rel.logical.LogicalJoin)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>computeScore</h4>
<pre class="methodSignature">private&nbsp;double&nbsp;computeScore&#8203;(<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;factRel,
<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;dimRel,
<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&nbsp;semiJoin)</pre>
<div class="block">Computes a score relevant to applying a set of semijoins on a fact table.
The higher the score, the better.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>factRel</code> - fact table being filtered</dd>
<dd><code>dimRel</code> - dimension table that participates in semijoin</dd>
<dd><code>semiJoin</code> - semijoin between fact and dimension tables</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>computed score of applying the dimension table filters on the
fact table</dd>
</dl>
</li>
</ul>
<a id="removeJoin(org.apache.calcite.rel.rules.LoptMultiJoin,org.apache.calcite.rel.logical.LogicalJoin,int,int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeJoin</h4>
<pre class="methodSignature">private&nbsp;void&nbsp;removeJoin&#8203;(<a href="LoptMultiJoin.html" title="class in org.apache.calcite.rel.rules">LoptMultiJoin</a>&nbsp;multiJoin,
<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&nbsp;semiJoin,
int&nbsp;factIdx,
int&nbsp;dimIdx)</pre>
<div class="block">Determines whether a join of the dimension table in a semijoin can be
removed. It can be if the dimension keys are unique and the only fields
referenced from the dimension table are its semijoin keys. The semijoin
keys can be mapped to the corresponding keys from the fact table (because
of the equality condition associated with the semijoin keys). Therefore,
that's why the dimension table can be removed even though those fields
are referenced elsewhere in the query tree.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>multiJoin</code> - join factors being optimized</dd>
<dd><code>semiJoin</code> - semijoin under consideration</dd>
<dd><code>factIdx</code> - id of the fact table in the semijoin</dd>
<dd><code>dimIdx</code> - id of the dimension table in the semijoin</dd>
</dl>
</li>
</ul>
<a id="removePossibleSemiJoin(java.util.Map,java.lang.Integer,java.lang.Integer)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removePossibleSemiJoin</h4>
<pre class="methodSignature">private&nbsp;void&nbsp;removePossibleSemiJoin&#8203;(java.util.Map&lt;java.lang.Integer,&#8203;<a href="../logical/LogicalJoin.html" title="class in org.apache.calcite.rel.logical">LogicalJoin</a>&gt;&nbsp;possibleDimensions,
java.lang.Integer&nbsp;factIdx,
java.lang.Integer&nbsp;dimIdx)</pre>
<div class="block">Removes a dimension table from a fact table's list of possible semijoins</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>possibleDimensions</code> - possible dimension tables associated with the
fact table</dd>
<dd><code>factIdx</code> - index corresponding to fact table</dd>
<dd><code>dimIdx</code> - index corresponding to dimension table</dd>
</dl>
</li>
</ul>
<a id="getChosenSemiJoin(int)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getChosenSemiJoin</h4>
<pre class="methodSignature">public&nbsp;<a href="../RelNode.html" title="interface in org.apache.calcite.rel">RelNode</a>&nbsp;getChosenSemiJoin&#8203;(int&nbsp;factIdx)</pre>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>factIdx</code> - index corresponding to the desired factor</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>optimal semijoin for the specified factor; may be the factor
itself if semijoins are not chosen for the factor</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../index.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/LoptSemiJoinOptimizer.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
<p class="legalCopy"><small>Copyright &#169; 2012&#x2013;2019 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</body>
</html>