The multicomponent interval encoded index. More...
#include <irelic.h>
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 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. | |
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. | |
sbiad (const ibis::column *c=0, const char *f=0, const uint32_t nbase=2) | |
Constructor. | |
sbiad (const ibis::column *c, ibis::fileManager::storage *st, size_t start=8) | |
Reconstruct an index from a storage object. | |
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. |
The multicomponent interval encoded index.
Defined by Chan and Ioannidis (SIGMOD 99).
ibis::sbiad::sbiad | ( | const ibis::column * | c = 0 , |
const char * | f = 0 , |
||
const uint32_t | nbase = 2 |
||
) |
Constructor.
If an index exists in the specified location, it will be read, otherwise a new bitmap index will be created from current data.
References ibis::index::bits, ibis::fade::clear(), ibis::index::col, ibis::gVerbose, ibis::part::name(), ibis::column::name(), ibis::part::nRows(), ibis::index::nrows, print(), and ibis::array_t< T >::size().
ibis::sbiad::sbiad | ( | const ibis::column * | c, |
ibis::fileManager::storage * | st, | ||
size_t | start = 8 |
||
) |
Reconstruct an index from a storage object.
The content of the file (following the 8-byte header) is as follows:
nrows(uint32_t) -- the number of bits in a 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::index::bits, ibis::index::col, ibis::gVerbose, ibis::part::name(), ibis::column::name(), ibis::index::nrows, print(), and ibis::array_t< T >::size().
long ibis::sbiad::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::fade.
References ibis::util::clear().
long ibis::sbiad::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::fade.
References ibis::bitvector::cnt(), ibis::qDiscreteRange::getValues(), ibis::bitvector::set(), ibis::array_t< T >::size(), and ibis::bitvector::size().
virtual const char* ibis::sbiad::name | ( | ) | const [inline, virtual] |
Returns the name of the index, similar to the function type
, but returns a string instead.
Reimplemented from ibis::fade.
int ibis::sbiad::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::fade.
References ibis::fileManager::flushFile(), ibis::gVerbose, ibis::fileManager::instance(), ibis::index::SBIAD, UnixOpen, ibis::fade::write32(), and ibis::fade::write64().
![]() |