Directly use the integer values as bin number to avoid some intemdiate steps. More...
#include <idirekte.h>
Public Member Functions | |
virtual long | append (const char *dt, const char *df, uint32_t nnew) |
Extend the index. | |
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 |
direkte (const ibis::column *c, const char *f=0) | |
Constructing a new ibis::direkte object from base data in a file. | |
direkte (const ibis::column *c, ibis::fileManager::storage *st) | |
virtual void | estimate (const ibis::qContinuousRange &expr, ibis::bitvector &lower, ibis::bitvector &upper) const |
Computes an approximation of hits as a pair of lower and upper bounds. | |
virtual void | estimate (const ibis::qDiscreteRange &expr, ibis::bitvector &lower, ibis::bitvector &upper) const |
Estimate the hits for discrete ranges, i.e., those translated from 'a IN (x, y, ..)'. | |
virtual uint32_t | estimate (const ibis::qContinuousRange &expr) const |
Returns an upper bound on the number of hits. | |
virtual uint32_t | estimate (const ibis::qDiscreteRange &expr) const |
virtual double | estimateCost (const ibis::qContinuousRange &expr) const |
Estimate the code of evaluate a range condition. | |
virtual double | estimateCost (const ibis::qDiscreteRange &expr) const |
virtual long | evaluate (const ibis::qContinuousRange &expr, ibis::bitvector &hits) const |
To evaluate the exact hits. | |
virtual long | evaluate (const ibis::qDiscreteRange &expr, ibis::bitvector &hits) const |
To evaluate the exact hits. | |
virtual long | getCumulativeDistribution (std::vector< double > &bds, std::vector< uint32_t > &cts) const |
Cumulative distribution of the data. | |
virtual long | getDistribution (std::vector< double > &bbs, std::vector< uint32_t > &cts) const |
Binned distribution of the data. | |
virtual double | getMax () const |
The maximum value recorded in the index. | |
virtual double | getMin () const |
The minimum value recorded in the index. | |
virtual double | getSum () const |
Compute the approximate sum of all the values 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 (ibis::fileManager::storage *st) |
Reconstruct an index from a piece of consecutive memory. | |
virtual int | read (const char *name) |
Read index from the specified location. | |
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::qDiscreteRange &expr, ibis::bitvector &iffy) const |
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 *name) const |
Write the direct bitmap index to a file. | |
Protected Member Functions | |
template<typename T > | |
int | construct (const char *f) |
direkte (const direkte &) | |
virtual size_t | getSerialSize () const throw () |
Estiamte the size of the index file. | |
void | locate (const ibis::qContinuousRange &expr, uint32_t &hit0, uint32_t &hit1) const |
direkte & | operator= (const direkte &) |
Directly use the integer values as bin number to avoid some intemdiate steps.
long ibis::direkte::append | ( | const char * | dt, |
const char * | df, | ||
uint32_t | nnew | ||
) | [virtual] |
Extend the index.
Append the index in df to the one in dt.
If the index in df exists, then it will be used, otherwise it simply creates a new index using the data in dt.
Reimplemented from ibis::index.
References ibis::fileManager::storage::begin(), ibis::index::bits, ibis::BYTE, ibis::CATEGORY, ibis::index::DIREKTE, ibis::fileManager::getFile(), ibis::gVerbose, ibis::fileManager::instance(), ibis::INT, ibis::LONG, ibis::index::nrows, ibis::index::offset32, ibis::index::offset64, ibis::SHORT, ibis::index::str, ibis::fileManager::storage::swap(), ibis::TYPESTRING, ibis::UBYTE, ibis::UINT, ibis::ULONG, and ibis::USHORT.
void ibis::direkte::binBoundaries | ( | std::vector< double > & | ) | const [virtual] |
The function binBoundaries and binWeights return bin boundaries and counts of each bin respectively.
Reimplemented from ibis::index.
void ibis::direkte::estimate | ( | const ibis::qContinuousRange & | , |
ibis::bitvector & | lower, | ||
ibis::bitvector & | upper | ||
) | const [virtual] |
Computes an approximation of hits as a pair of lower and upper bounds.
expr | the query expression to be evaluated. |
lower | a bitvector marking a subset of the hits. All rows marked with one (1) are definitely hits. |
upper | a bitvector marking a superset of the hits. All hits are marked with one, but some of the rows marked one may not be hits. If the variable upper is empty, the variable lower is assumed to contain the exact answer. |
Reimplemented from ibis::index.
References ibis::bitvector::clear().
void ibis::direkte::estimate | ( | const ibis::qDiscreteRange & | expr, |
ibis::bitvector & | lower, | ||
ibis::bitvector & | upper | ||
) | const [virtual] |
Estimate the hits for discrete ranges, i.e., those translated from 'a IN (x, y, ..)'.
A trivial implementation to indicate the index can not determine any row.
Reimplemented from ibis::index.
References ibis::bitvector::clear(), ibis::qDiscreteRange::getValues(), ibis::bitvector::set(), and ibis::array_t< T >::size().
long ibis::direkte::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.
Implements ibis::index.
References ibis::bitvector::cnt().
long ibis::direkte::evaluate | ( | const ibis::qDiscreteRange & | , |
ibis::bitvector & | |||
) | const [virtual] |
To evaluate the exact hits.
On success, return the number of hits, otherwise a negative value is returned.
Reimplemented from ibis::index.
References ibis::bitvector::cnt(), ibis::qDiscreteRange::getValues(), ibis::bitvector::set(), and ibis::array_t< T >::size().
long ibis::direkte::getCumulativeDistribution | ( | std::vector< double > & | bds, |
std::vector< uint32_t > & | cts | ||
) | const [virtual] |
Cumulative distribution of the data.
A brute-force approach to get an accurate cumulative distribution.
Reimplemented from ibis::index.
long ibis::direkte::getDistribution | ( | std::vector< double > & | bbs, |
std::vector< uint32_t > & | cts | ||
) | const [virtual] |
Binned distribution of the data.
A brute-force approach to get an accurate distribution.
Reimplemented from ibis::index.
size_t ibis::direkte::getSerialSize | ( | ) | const throw () [protected, virtual] |
Estiamte the size of the index file.
The index file contains primarily the bitmaps.
double ibis::direkte::getSum | ( | ) | const [virtual] |
Compute the approximate sum of all the values indexed.
If it decides that computing the sum directly from the vertical partition is more efficient, it will return NaN immediately.
Reimplemented from ibis::index.
virtual const char* ibis::direkte::name | ( | ) | const [inline, virtual] |
Returns the name of the index, similar to the function type
, but returns a string instead.
Implements ibis::index.
virtual float ibis::direkte::undecidable | ( | const ibis::qContinuousRange & | , |
ibis::bitvector & | |||
) | const [inline, virtual] |
Mark the position of the rows that can not be decided with this index.
expr | the range conditions to be evaluated. |
iffy | the 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::index.
References ibis::bitvector::clear().
![]() |