blob: 37d570339dbe9fee37ad28c75a51eb71f7e42078 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RelOptCost (Apache Calcite calcite API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="RelOptCost (Apache Calcite calcite API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</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 class="aboutLanguage"><b>Apache Calcite</b></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/calcite/plan/RelOptConnection.html" title="interface in org.apache.calcite.plan"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/calcite/plan/RelOptCostFactory.html" title="interface in org.apache.calcite.plan"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/calcite/plan/RelOptCost.html" target="_top">Frames</a></li>
<li><a href="RelOptCost.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.calcite.plan</div>
<h2 title="Interface RelOptCost" class="title">Interface RelOptCost</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/calcite/plan/RelOptCostImpl.html" title="class in org.apache.calcite.plan">RelOptCostImpl</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">RelOptCost</span></pre>
<div class="block">RelOptCost defines an interface for optimizer cost in terms of number of rows
processed, CPU cost, and I/O cost. Optimizer implementations may use all of
this information, or selectively ignore portions of it. The specific units
for all of these quantities are rather vague; most relational expressions
provide a default cost calculation, but optimizers can override this by
plugging in their own cost models with well-defined meanings for each unit.
Optimizers which supply their own cost models may also extend this interface
with additional cost metrics such as memory usage.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<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="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#divideBy-org.apache.calcite.plan.RelOptCost-">divideBy</a></span>(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</code>
<div class="block">Computes the ratio between this cost and another cost.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#equals-org.apache.calcite.plan.RelOptCost-">equals</a></span>(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</code>
<div class="block">Compares this to another cost.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#getCpu--">getCpu</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#getIo--">getIo</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#getRows--">getRows</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#isEqWithEpsilon-org.apache.calcite.plan.RelOptCost-">isEqWithEpsilon</a></span>(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</code>
<div class="block">Compares this to another cost, allowing for slight roundoff errors.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#isInfinite--">isInfinite</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#isLe-org.apache.calcite.plan.RelOptCost-">isLe</a></span>(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</code>
<div class="block">Compares this to another cost.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#isLt-org.apache.calcite.plan.RelOptCost-">isLt</a></span>(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</code>
<div class="block">Compares this to another cost.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#minus-org.apache.calcite.plan.RelOptCost-">minus</a></span>(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</code>
<div class="block">Subtracts another cost from this.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#multiplyBy-double-">multiplyBy</a></span>(double&nbsp;factor)</code>
<div class="block">Multiplies this cost by a scalar factor.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#plus-org.apache.calcite.plan.RelOptCost-">plus</a></span>(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</code>
<div class="block">Adds another cost to this.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/calcite/plan/RelOptCost.html#toString--">toString</a></span>()</code>
<div class="block">Forces implementations to override <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang"><code>Object.toString()</code></a> and provide a
good cost rendering to use during tracing.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getRows--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getRows</h4>
<pre>double&nbsp;getRows()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>number of rows processed; this should not be confused with the
row count produced by a relational expression
(<a href="../../../../org/apache/calcite/rel/RelNode.html#estimateRowCount-org.apache.calcite.rel.metadata.RelMetadataQuery-"><code>RelNode.estimateRowCount(org.apache.calcite.rel.metadata.RelMetadataQuery)</code></a>)</dd>
</dl>
</li>
</ul>
<a name="getCpu--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCpu</h4>
<pre>double&nbsp;getCpu()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>usage of CPU resources</dd>
</dl>
</li>
</ul>
<a name="getIo--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIo</h4>
<pre>double&nbsp;getIo()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>usage of I/O resources</dd>
</dl>
</li>
</ul>
<a name="isInfinite--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isInfinite</h4>
<pre>boolean&nbsp;isInfinite()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff this cost represents an expression that hasn't actually
been implemented (e.g. a pure relational algebra expression) or can't
actually be implemented, e.g. a transfer of data between two disconnected
sites</dd>
</dl>
</li>
</ul>
<a name="equals-org.apache.calcite.plan.RelOptCost-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>boolean&nbsp;equals(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</pre>
<div class="block">Compares this to another cost.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cost</code> - another cost</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff this is exactly equal to other cost</dd>
</dl>
</li>
</ul>
<a name="isEqWithEpsilon-org.apache.calcite.plan.RelOptCost-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEqWithEpsilon</h4>
<pre>boolean&nbsp;isEqWithEpsilon(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</pre>
<div class="block">Compares this to another cost, allowing for slight roundoff errors.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cost</code> - another cost</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff this is the same as the other cost within a roundoff
margin of error</dd>
</dl>
</li>
</ul>
<a name="isLe-org.apache.calcite.plan.RelOptCost-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLe</h4>
<pre>boolean&nbsp;isLe(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</pre>
<div class="block">Compares this to another cost.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cost</code> - another cost</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff this is less than or equal to other cost</dd>
</dl>
</li>
</ul>
<a name="isLt-org.apache.calcite.plan.RelOptCost-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLt</h4>
<pre>boolean&nbsp;isLt(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</pre>
<div class="block">Compares this to another cost.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cost</code> - another cost</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff this is strictly less than other cost</dd>
</dl>
</li>
</ul>
<a name="plus-org.apache.calcite.plan.RelOptCost-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>plus</h4>
<pre><a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;plus(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</pre>
<div class="block">Adds another cost to this.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cost</code> - another cost</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>sum of this and other cost</dd>
</dl>
</li>
</ul>
<a name="minus-org.apache.calcite.plan.RelOptCost-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>minus</h4>
<pre><a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;minus(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</pre>
<div class="block">Subtracts another cost from this.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cost</code> - another cost</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>difference between this and other cost</dd>
</dl>
</li>
</ul>
<a name="multiplyBy-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>multiplyBy</h4>
<pre><a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;multiplyBy(double&nbsp;factor)</pre>
<div class="block">Multiplies this cost by a scalar factor.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>factor</code> - scalar factor</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>scalar product of this and factor</dd>
</dl>
</li>
</ul>
<a name="divideBy-org.apache.calcite.plan.RelOptCost-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>divideBy</h4>
<pre>double&nbsp;divideBy(<a href="../../../../org/apache/calcite/plan/RelOptCost.html" title="interface in org.apache.calcite.plan">RelOptCost</a>&nbsp;cost)</pre>
<div class="block">Computes the ratio between this cost and another cost.
<p>divideBy is the inverse of <a href="../../../../org/apache/calcite/plan/RelOptCost.html#multiplyBy-double-"><code>multiplyBy(double)</code></a>. For any
finite, non-zero cost and factor f, <code>
cost.divideBy(cost.multiplyBy(f))</code> yields <code>1 / f</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>cost</code> - Other cost</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Ratio between costs</dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<div class="block">Forces implementations to override <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang"><code>Object.toString()</code></a> and provide a
good cost rendering to use during tracing.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</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 class="aboutLanguage"><b>Apache Calcite</b></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/calcite/plan/RelOptConnection.html" title="interface in org.apache.calcite.plan"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/calcite/plan/RelOptCostFactory.html" title="interface in org.apache.calcite.plan"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/calcite/plan/RelOptCost.html" target="_top">Frames</a></li>
<li><a href="RelOptCost.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.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>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &copy; 2012-2020 Apache Software Foundation. All Rights Reserved.</small></p>
</body>
</html>