Public Member Functions | Protected Member Functions | Protected Attributes
ibis::fade Class Reference

The multicomponent range-encoded index. More...

#include <irelic.h>

Inheritance diagram for ibis::fade:
ibis::relic ibis::index ibis::sapid ibis::sbiad

List of all members.

Public Member Functions

virtual long append (const char *dt, const char *df, uint32_t nnew)
 Create an index based on data in df and append the result to the index in dt.
virtual void binWeights (std::vector< uint32_t > &b) const
 Return the exact count for each distinct value.
virtual uint32_t estimate (const ibis::qContinuousRange &expr) const
 Return the number of hits satisfying the given continuous range expression.
virtual double estimateCost (const ibis::qContinuousRange &expr) const
 Estimate the cost of resolving the continuous range expression.
virtual long evaluate (const ibis::qContinuousRange &expr, ibis::bitvector &hits) const
 Compute the hits as a bitvector.
virtual long evaluate (const ibis::qDiscreteRange &expr, ibis::bitvector &hits) const
 Resolve a discrete range condition.
 fade (const ibis::column *c=0, const char *f=0, const uint32_t nbase=2)
 Construct a bitmap index from current data.
 fade (const ibis::column *c, ibis::fileManager::storage *st, size_t start=8)
 Reconstruct from content of fileManager::storage.
virtual double getSum () const
 Compute the sum of all values of the column indexed.
virtual const char * name () const
 Returns the name of the index, similar to the function type, but returns a string instead.
virtual void print (std::ostream &out) const
 The printing function.
virtual int read (const char *idxfile)
 Read the index contained in the file named f.
virtual int read (ibis::fileManager::storage *st)
 Reconstruct an index from a piece of consecutive memory.
virtual long select (const ibis::qContinuousRange &, void *) const
 Evaluate the range condition and select values.
virtual long select (const ibis::qContinuousRange &, void *, ibis::bitvector &) const
 Evaluate the range condition, select values, and record the positions.
virtual void speedTest (std::ostream &out) const
 A simple function to test the speed of the bitvector operations.
virtual INDEX_TYPE type () const
 Returns an index type identifier.
virtual int write (const char *dt) const
 Write the content of this index to a file.

Protected Member Functions

virtual void clear ()
 Clear the existing content.
virtual size_t getSerialSize () const throw ()
 Estiamte the size of the index in a file.
int write32 (int fdes) const
 Write the content to a file already opened.
int write64 (int fdes) const
 Write the content to a file already opened.

Protected Attributes

array_t< uint32_t > bases
array_t< uint32_t > cnts

Detailed Description

The multicomponent range-encoded index.

Defined by Chan and Ioannidis (SIGMOD 98).


Constructor & Destructor Documentation

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

Reconstruct from content of fileManager::storage.

The content of the file (following the 8-byte header) is

  • nrows(uint32_t) -- the number of bits in each bit sequence
  • nobs (uint32_t) -- the number of bit sequences
  • card (uint32_t) -- the number of distinct values, i.e., cardinality
  • (padding to ensure the next data element is on 8-byte boundary)
  • values (double[card]) -- the distinct values as doubles
  • offset([nobs+1]) -- the starting positions of the bit sequences (as bit vectors)
  • nbases(uint32_t) -- the number of components (bases) used
  • cnts (uint32_t[card]) -- the counts for each distinct value
  • bases(uint32_t[nbases])-- the bases sizes
  • bitvectors -- the bitvectors one after another

References ibis::fileManager::storage::begin(), ibis::index::bits, ibis::index::col, ibis::index::FADE, ibis::gVerbose, ibis::part::name(), ibis::column::name(), ibis::index::nrows, print(), ibis::array_t< T >::size(), and ibis::array_t< T >::swap().


Member Function Documentation

long ibis::fade::append ( const char *  dt,
const char *  df,
uint32_t  nnew 
) [virtual]

Create an index based on data in df and append the result to the index in dt.

Reimplemented from ibis::relic.

Reimplemented in ibis::sapid, and ibis::sbiad.

References ibis::util::clear().

void ibis::fade::clear ( ) [protected, virtual]

Clear the existing content.

Free the objectes pointed to by the pointers.

Reimplemented from ibis::relic.

References ibis::util::clear().

Referenced by fade(), ibis::sapid::sapid(), and ibis::sbiad::sbiad().

uint32_t ibis::fade::estimate ( const ibis::qContinuousRange expr) const [virtual]

Return the number of hits satisfying the given continuous range expression.

Reimplemented from ibis::relic.

double ibis::fade::estimateCost ( const ibis::qContinuousRange expr) const [virtual]

Estimate the cost of resolving the continuous range expression.

The answer is in the number of bytes needed from this index.

Reimplemented from ibis::relic.

long ibis::fade::evaluate ( const ibis::qDiscreteRange expr,
ibis::bitvector answer 
) const [virtual]

Resolve a discrete range condition.

The answer is a bitvector marking the rows satisfying the range conditions.

Reimplemented from ibis::relic.

Reimplemented in ibis::sapid, and ibis::sbiad.

References ibis::bitvector::cnt(), ibis::qDiscreteRange::getValues(), ibis::bitvector::set(), ibis::array_t< T >::size(), and ibis::bitvector::size().

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

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

Reimplemented from ibis::relic.

Reimplemented in ibis::sapid, and ibis::sbiad.

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

Write the content of this index to a file.

The argument is the name of the directory or the index file name.

Reimplemented from ibis::relic.

Reimplemented in ibis::sapid, and ibis::sbiad.

References ibis::index::FADE, ibis::fileManager::flushFile(), ibis::gVerbose, ibis::fileManager::instance(), and UnixOpen.


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