com.sleepycat.je.tree
Class CountEstimator

java.lang.Object
  extended by com.sleepycat.je.tree.CountEstimator

public class CountEstimator
extends Object

Estimates the number of non-deleted BIN entries between two end points, using information returned in TrackingInfo from Tree.getParentINForChildIN. Used for estimating dup counts, e.g., for join query optimization. Accuracy is limited by the number of samples taken to compute the average number of entries at each level. Currently only two samples (at the end points) are taken, and because the tree is not balanced making the number of entries highly variable, the count can easily be off by a factor of two.


Nested Class Summary
(package private) static class CountEstimator.KeyRatios
           
 
Method Summary
static long count(DatabaseImpl dbImpl, CursorImpl beginCursor, boolean beginInclusive, CursorImpl endCursor, boolean endInclusive)
          Returns an estimate of the number of records between two end points specified by begin/end cursor positions.
(package private) static CountEstimator.KeyRatios getKeyRatios(List<TrackingInfo> infoByLevel, boolean exact)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

count

public static long count(DatabaseImpl dbImpl,
                         CursorImpl beginCursor,
                         boolean beginInclusive,
                         CursorImpl endCursor,
                         boolean endInclusive)
Returns an estimate of the number of records between two end points specified by begin/end cursor positions.


getKeyRatios

static CountEstimator.KeyRatios getKeyRatios(List<TrackingInfo> infoByLevel,
                                             boolean exact)


Copyright (c) 2004-2012 Oracle. All rights reserved.