net.sf.farrago.catalog
Class FarragoColumnHistogram.HistogramBarCoverage

java.lang.Object
  extended by net.sf.farrago.catalog.FarragoColumnHistogram.HistogramBarCoverage
Enclosing class:
FarragoColumnHistogram

private static class FarragoColumnHistogram.HistogramBarCoverage
extends Object

Describes which points and ranges lie on a histogram bar


Field Summary
private  int cardinalityPoint
           
private  int cardinalityRanges
           
private  boolean entireBar
           
private  int selectivityPoints
           
private  int selectivityRanges
           
 
Constructor Summary
private FarragoColumnHistogram.HistogramBarCoverage()
           
 
Method Summary
protected static void addRange(List<FarragoColumnHistogram.HistogramBarCoverage> coverages, FarragoColumnHistogram.HistogramRange range, String minVal)
          Determines how a histogram range, possibly spanning several bars, covers each histogram bar, and accumulates a running total of the coverage.
protected  Double estimateCardinality(Double cardinality)
          Estimates the cardinality of the column after applying a predicate.
protected  Double estimateFraction(Double cardinality)
          Estimates what percentage of a bar is covered, based on the bar's total cardinality.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entireBar

private boolean entireBar

cardinalityPoint

private int cardinalityPoint

cardinalityRanges

private int cardinalityRanges

selectivityPoints

private int selectivityPoints

selectivityRanges

private int selectivityRanges
Constructor Detail

FarragoColumnHistogram.HistogramBarCoverage

private FarragoColumnHistogram.HistogramBarCoverage()
Method Detail

addRange

protected static void addRange(List<FarragoColumnHistogram.HistogramBarCoverage> coverages,
                               FarragoColumnHistogram.HistogramRange range,
                               String minVal)
Determines how a histogram range, possibly spanning several bars, covers each histogram bar, and accumulates a running total of the coverage.

Parameters:
coverages - set of coverages for each bar
range - histogram bar range to be tabulated

estimateFraction

protected Double estimateFraction(Double cardinality)
Estimates what percentage of a bar is covered, based on the bar's total cardinality.

Parameters:
cardinality - the expected cardinality of the bar
Returns:
an estimate from 0.0 to 1.0 representing a fraction of a bar, or null if no reliable estimate can be made

estimateCardinality

protected Double estimateCardinality(Double cardinality)
Estimates the cardinality of the column after applying a predicate.

Parameters:
cardinality - the expected cardinality of the bar
Returns:
an estimate of the cardinality of the column after applying the predicate, or null if no reliable estimate can be made