Skip to content

Commit

Permalink
Fix bug in CBO stats
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjalssh authored and rschlussel committed Dec 21, 2022
1 parent c4401f6 commit 15788ac
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public double getOutputSizeInBytes(PlanNode planNode)
{
requireNonNull(planNode, "planNode is null");

if (sourceInfo.isConfident() && !isNaN(totalSize)) {
if (!sourceInfo.estimateSizeUsingVariables() && !isNaN(totalSize)) {
return totalSize;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,10 @@ public boolean isConfident()
{
return confident;
}

@Override
public boolean estimateSizeUsingVariables()
{
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,13 @@
public abstract class SourceInfo
{
public abstract boolean isConfident();

/**
* Whether to estimate size of plan output using variable statistics.
* If false, we will use estimated size in plan statistics itself.
*/
public boolean estimateSizeUsingVariables()
{
return false;
}
}

0 comments on commit 15788ac

Please sign in to comment.