Public Member Functions | Protected Member Functions
ibis::mesa Class Reference

This class implements the interval encoding of Chan and Ioannidis. More...

#include <ibin.h>

Inheritance diagram for ibis::mesa:
ibis::bin ibis::index

List of all members.

Public Member Functions

virtual long append (const char *dt, const char *df, uint32_t nnew)
 Create index for the data in df and append the result to the index in dt.
long append (const ibis::mesa &tail)
virtual void binBoundaries (std::vector< double > &) const
 The function binBoundaries and binWeights return bin boundaries and counts of each bin respectively.
virtual void binWeights (std::vector< uint32_t > &) const
virtual void estimate (const ibis::qContinuousRange &expr, ibis::bitvector &lower, ibis::bitvector &upper) const
 Provide an estimation based on the current index.
virtual uint32_t estimate (const ibis::qContinuousRange &expr) const
 Compute an upper bound on the number of hits.
virtual long evaluate (const ibis::qDiscreteRange &expr, ibis::bitvector &hits) const
 To evaluate the exact hits.
virtual long evaluate (const ibis::qContinuousRange &expr, ibis::bitvector &hits) const
 To evaluate the exact hits.
virtual double getSum () const
 Compute the approximate value of the sum from the binned index.
 mesa (const ibis::bin &rhs)
 Constructor.
 mesa (const ibis::column *c=0, const char *f=0)
 Constructor. Generate index from the base data.
 mesa (const ibis::column *c, ibis::fileManager::storage *st, size_t offset=8)
 Constructor.
virtual const char * name () const
 Returns the name of the index, similar to the function type, but returns a string instead.
virtual uint32_t numBins () const
virtual void print (std::ostream &out) const
 Prints human readable information.
virtual void speedTest (std::ostream &out) const
 Time some logical operations and print out their speed.
virtual INDEX_TYPE type () const
 Returns an index type identifier.
virtual float undecidable (const ibis::qContinuousRange &expr, ibis::bitvector &iffy) const
 Mark the position of the rows that can not be decided with this index.
virtual int write (const char *dt) const
 Write the content of the index the specified location.

Protected Member Functions

virtual double computeSum () const
 Compute the sum of values from the information in the index.
void construct (const char *)
 Construct a new index.
virtual size_t getSerialSize () const throw ()
 Estimate the size of serialized version of the index.

Detailed Description

This class implements the interval encoding of Chan and Ioannidis.


Constructor & Destructor Documentation

ibis::mesa::mesa ( const ibis::column c,
ibis::fileManager::storage st,
size_t  start = 8 
)

Constructor.

Reconstruct an index from a storage object. The layout of data members are the same as ibis::bin. The difference is that the last half of the bit vectors are always empty.

References ibis::index::col, ibis::gVerbose, ibis::column::name(), ibis::part::name(), ibis::bin::nobs, ibis::index::nrows, and print().

ibis::mesa::mesa ( const ibis::bin rhs) [explicit]

Constructor.

Construct an interval encoded index from an equality encoded index.

References ibis::index::bits, ibis::bin::bounds, ibis::index::col, ibis::bitvector::copy(), ibis::gVerbose, ibis::bin::maxval, ibis::bin::minval, ibis::bin::nobs, and ibis::index::nrows.


Member Function Documentation

void ibis::mesa::binBoundaries ( std::vector< double > &  ) const [virtual]

The function binBoundaries and binWeights return bin boundaries and counts of each bin respectively.

Reimplemented from ibis::bin.

double ibis::mesa::computeSum ( ) const [protected, virtual]

Compute the sum of values from the information in the index.

Compute the approximate sum of all values using the binned index.

Reimplemented from ibis::bin.

References ibis::bitvector::cnt().

void ibis::mesa::construct ( const char *  df) [protected]

Construct a new index.

Constructor an new index from data file in the specified location.

This function first construct equality bins then convert to the interval encoding.

Reimplemented from ibis::bin.

References ibis::bin::construct(), and ibis::gVerbose.

void ibis::mesa::estimate ( const ibis::qContinuousRange expr,
ibis::bitvector lower,
ibis::bitvector upper 
) const [virtual]

Provide an estimation based on the current index.

Set bits in lower are hits for certain, set bits in upper are candidates. Set bits in (upper - lower) should be checked to verifies which ones are actually hits. If the bitvector upper contain less bits than bitvector lower, the content of upper is assumed to be the same as lower.

Note:
This function will not do anything if the estimated cost is high.

Reimplemented from ibis::bin.

References ibis::bitvector::clear(), ibis::bitvector::copy(), ibis::bitvector::set(), and ibis::bitvector::size().

long ibis::mesa::evaluate ( const ibis::qContinuousRange expr,
ibis::bitvector hits 
) const [virtual]

To evaluate the exact hits.

On success, return the number of hits, otherwise a negative value is returned.

Reimplemented from ibis::bin.

References ibis::bitvector::cnt(), ibis::bitvector::copy(), ibis::bitvector::set(), and ibis::bitvector::size().

virtual long ibis::mesa::evaluate ( const ibis::qDiscreteRange ,
ibis::bitvector  
) const [inline, virtual]

To evaluate the exact hits.

On success, return the number of hits, otherwise a negative value is returned.

Reimplemented from ibis::bin.

References ibis::range::evaluate().

size_t ibis::mesa::getSerialSize ( ) const throw () [protected, virtual]

Estimate the size of serialized version of the index.

The estimation assumes the bitmap offsets are stored in 8-byte offsets. The size is measured in bytes.

Reimplemented from ibis::bin.

virtual const char* ibis::mesa::name ( ) const [inline, virtual]

Returns the name of the index, similar to the function type, but returns a string instead.

Reimplemented from ibis::bin.

void ibis::mesa::print ( std::ostream &  out) const [virtual]

Prints human readable information.

Outputs information about the index as text to the specified output stream.

Reimplemented from ibis::bin.

References ibis::gVerbose.

Referenced by mesa().

float ibis::mesa::undecidable ( const ibis::qContinuousRange ,
ibis::bitvector  
) const [virtual]

Mark the position of the rows that can not be decided with this index.

Parameters:
exprthe range conditions to be evaluated.
iffythe bitvector marking the positions of rows that can not be decided using the index. Return value is the expected fraction of undecided rows that might satisfy the range conditions.

Reimplemented from ibis::bin.

References ibis::bitvector::cnt(), ibis::qContinuousRange::leftBound(), ibis::qContinuousRange::rightBound(), ibis::bitvector::set(), and ibis::bitvector::size().

int ibis::mesa::write ( const char *  dt) const [virtual]

Write the content of the index the specified location.

The argument dt can be either a directory name or a file name. The actual file name to use for exporting the index is determined by the function indexFileName. The layout of the member variables is the same as with ibis::bin.

Reimplemented from ibis::bin.

References ibis::fileManager::flushFile(), ibis::gVerbose, ibis::fileManager::instance(), ibis::index::MESA, UnixOpen, ibis::bin::write32(), and ibis::bin::write64().


The documentation for this class was generated from the following files:

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive