The bit-sliced index. More...
#include <irelic.h>
Public Member Functions | |
| virtual long | append (const char *dt, const char *df, uint32_t nnew) |
| Create index based data in dt. Have to start from data directly. | |
| virtual const char * | name () const |
Returns the name of the index, similar to the function type, but returns a string instead. More... | |
| virtual void | print (std::ostream &out) const |
| The printing function. | |
| slice (const ibis::column *c=0, const char *f=0) | |
| Construct a bitmap index from current data. | |
| slice (const ibis::column *c, ibis::fileManager::storage *st, size_t start=8) | |
| Reconstruct from content of a storage object. More... | |
| virtual INDEX_TYPE | type () const |
| Returns an index type identifier. | |
| virtual int | write (const char *dt) const |
| Write the content of the index to the specified location. More... | |
Public Member Functions inherited from ibis::skive | |
| virtual void | binWeights (std::vector< uint32_t > &b) const |
| Return the exact count for each distinct value. | |
| 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. More... | |
| virtual uint32_t | estimate (const ibis::qContinuousRange &expr) const |
| Return the number of hits satisfying the given continuous range expression. More... | |
| virtual double | estimateCost (const ibis::qContinuousRange &) const |
| Estimate the cost of resolving the continuous range expression. More... | |
| virtual double | estimateCost (const ibis::qDiscreteRange &expr) const |
| Estimate the cost of resolving the discrete range expression. More... | |
| 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. More... | |
| virtual double | getSum () const |
| Compute the sum of all values of the column indexed. | |
| virtual int | read (const char *idxfile) |
| Read the index contained in the file f. More... | |
| virtual int | read (ibis::fileManager::storage *st) |
| Reconstruct an index from a piece of consecutive memory. More... | |
| 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. | |
| skive (const ibis::column *c=0, const char *f=0) | |
| Construct a bitmap index from current data. | |
| skive (const ibis::column *c, ibis::fileManager::storage *st, size_t start=8) | |
| Reconstruct from content of a storage object. More... | |
| virtual void | speedTest (std::ostream &out) const |
| Time some logical operations and print out their speed. | |
Public Member Functions inherited from ibis::relic | |
| long | append (const ibis::relic &tail) |
| Append tail to this index. More... | |
| long | append (const array_t< uint32_t > &ind) |
| Append a list of integers. More... | |
| virtual void | binBoundaries (std::vector< double > &b) const |
| Return all distinct values as the bin boundaries. | |
| void | construct (const char *f=0) |
| Construct a new index in memory. More... | |
| template<typename E > | |
| void | construct (const array_t< E > &arr) |
| Construct an index from in-memory values. More... | |
| 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, ..)'. More... | |
| virtual uint32_t | estimate (const ibis::qDiscreteRange &) const |
| Compute the number of hits satisfying the discrete range expression. | |
| virtual void | estimate (const ibis::relic &idx2, const ibis::deprecatedJoin &expr, const ibis::bitvector &mask, ibis::bitvector64 &lower, ibis::bitvector64 &upper) const |
| Estimate the pairs for the range join operator. More... | |
| virtual void | estimate (const ibis::relic &idx2, const ibis::deprecatedJoin &expr, const ibis::bitvector &mask, const ibis::qRange *const range1, const ibis::qRange *const range2, ibis::bitvector64 &lower, ibis::bitvector64 &upper) const |
| virtual int64_t | estimate (const ibis::relic &idx2, const ibis::deprecatedJoin &expr, const ibis::bitvector &mask) const |
| Estimate an upper bound for the number of pairs produced from marked records. More... | |
| virtual int64_t | estimate (const ibis::relic &idx2, const ibis::deprecatedJoin &expr, const ibis::bitvector &mask, const ibis::qRange *const range1, const ibis::qRange *const range2) const |
| virtual long | getCumulativeDistribution (std::vector< double > &bds, std::vector< uint32_t > &cts) const |
| Compute a cumulative distribition. | |
| virtual long | getDistribution (std::vector< double > &bds, std::vector< uint32_t > &cts) const |
| Compute a histogram. | |
| virtual double | getMax () const |
| The maximum value recorded in the index. | |
| virtual double | getMin () const |
| The minimum value recorded in the index. | |
| array_t< uint32_t > * | keys (const ibis::bitvector &mask) const |
| Convert the bitvector mask into bin numbers. | |
| template<typename T > | |
| long | mergeValuesT (const array_t< T > &vs, const array_t< const bitvector * > &ps, array_t< T > &res) |
| A template function to merge list of values and a list of positions. More... | |
| relic (const ibis::column *c, const char *f=0) | |
| Construct a basic bitmap index. More... | |
| relic (const ibis::column *c, uint32_t popu, uint32_t ntpl=0) | |
| Construct a dummy index. More... | |
| relic (const ibis::column *c, uint32_t card, array_t< uint32_t > &ints) | |
| Construct an index from an integer array. | |
| relic (const ibis::column *c, ibis::fileManager::storage *st, size_t start=8) | |
| Reconstruct from content of fileManager::storage. More... | |
| virtual float | undecidable (const ibis::qContinuousRange &, ibis::bitvector &iffy) const |
| This class and its derived classes should produce exact answers, therefore no undecidable rows. More... | |
| virtual float | undecidable (const ibis::qDiscreteRange &, ibis::bitvector &iffy) const |
Public Member Functions inherited from ibis::index | |
| void | addBins (uint32_t ib, uint32_t ie, ibis::bitvector &res) const |
Add the sum of bits[ib] through bits[ie-1] to res. More... | |
| void | addBins (uint32_t ib, uint32_t ie, ibis::bitvector &res, const ibis::bitvector &tot) const |
Compute the sum of bit vectors [ib, ie). More... | |
| virtual int | contractRange (ibis::qContinuousRange &) const |
| virtual void | estimate (const ibis::index &idx2, const ibis::deprecatedJoin &expr, ibis::bitvector64 &lower, ibis::bitvector64 &upper) const |
| Estimate the pairs for the range join operator. | |
| virtual void | estimate (const ibis::index &idx2, const ibis::deprecatedJoin &expr, const ibis::bitvector &mask, ibis::bitvector64 &lower, ibis::bitvector64 &upper) const |
| Estimate the pairs for the range join operator. More... | |
| virtual void | estimate (const ibis::index &idx2, const ibis::deprecatedJoin &expr, const ibis::bitvector &mask, const ibis::qRange *const range1, const ibis::qRange *const range2, ibis::bitvector64 &lower, ibis::bitvector64 &upper) const |
| virtual int64_t | estimate (const ibis::index &idx2, const ibis::deprecatedJoin &expr) const |
| Estimate an upper bound for the number of pairs. | |
| virtual int64_t | estimate (const ibis::index &idx2, const ibis::deprecatedJoin &expr, const ibis::bitvector &mask) const |
| Estimate an upper bound for the number of pairs produced from marked records. More... | |
| virtual int64_t | estimate (const ibis::index &idx2, const ibis::deprecatedJoin &expr, const ibis::bitvector &mask, const ibis::qRange *const range1, const ibis::qRange *const range2) const |
| virtual void | estimate (const ibis::deprecatedJoin &expr, const ibis::bitvector &mask, const ibis::qRange *const range1, const ibis::qRange *const range2, ibis::bitvector64 &lower, ibis::bitvector64 &upper) const |
| Evaluating a join condition with one (likely composite) index. | |
| virtual int64_t | estimate (const ibis::deprecatedJoin &expr, const ibis::bitvector &mask, const ibis::qRange *const range1, const ibis::qRange *const range2) const |
| virtual int | expandRange (ibis::qContinuousRange &) const |
| The functions expandRange and contractRange expands or contracts the boundaries of a range condition so that the new range will have exact answers using the function estimate. More... | |
| virtual const ibis::bitvector * | getBitvector (uint32_t i) const |
| Return a pointer to the ith bitvector used in the index (may be 0). | |
| uint32_t | getNRows () const |
| Return the number of rows represented by this object. | |
| template<typename E > | |
| void | mapValues (const array_t< E > &val, VMap &bmap) |
| template<typename E > | |
| void | mapValues (const array_t< E > &val, histogram &hist, uint32_t count) |
| template<typename E > | |
| void | mapValues (const array_t< E > &val, array_t< E > &bounds, std::vector< uint32_t > &cnts) |
| template<typename E1 , typename E2 > | |
| void | mapValues (const array_t< E1 > &val1, const array_t< E2 > &val2, array_t< E1 > &bnd1, array_t< E2 > &bnd2, std::vector< uint32_t > &cnts) |
| Compute a two-dimensional histogram. More... | |
| virtual uint32_t | numBitvectors () const |
| Returns the number of bit vectors used by the index. | |
| float | sizeInBytes () const |
| Estiamte the size of this index object measured in bytes. More... | |
| void | sumBins (uint32_t ib, uint32_t ie, ibis::bitvector &res) const |
Sum up bits[ib:ie-1] and place the result in res. More... | |
| void | sumBins (uint32_t ib, uint32_t ie, ibis::bitvector &res, uint32_t ib0, uint32_t ie0) const |
| Compute a new sum for bit vectors [ib, ie) by taking advantage of the old sum for bitvectors [ib0, ie0). More... | |
| void | sumBins (const ibis::array_t< uint32_t > &, ibis::bitvector &) const |
| Sum up the bits in in the specified bins. | |
| virtual | ~index () |
| The destructor. | |
Static Public Member Functions | |
| static bool | isSuitable (const column &, const char *) |
| Are values of the given column suitable for a bit-sliced index? Returns true for yes. More... | |
Additional Inherited Members | |
Public Types inherited from ibis::index | |
|
typedef std::map< double, uint32_t > | histogram |
| enum | INDEX_TYPE { BINNING =0, RANGE, MESA, AMBIT, PALE, PACK, ZONE, RELIC, ROSTER, SKIVE, FADE, SBIAD, SAPID, EGALE, MOINS, ENTRE, BAK, BAK2, KEYWORDS, MESH, BAND, DIREKTE, GENERIC, BYLT, FUZZ, ZONA, FUGE, SLICE, EXTERN } |
| The integer values of this enum type are used in the index files to differentiate the indexes. More... | |
|
typedef std::map< double, ibis::bitvector * > | VMap |
Protected Member Functions inherited from ibis::skive | |
| virtual void | clear () |
| Free the memory hold by this object. | |
| void | evalEQ (ibis::bitvector &res, uint32_t b) const |
| Compute the bitvector that is the answer for the query x = b. | |
| void | evalGE (ibis::bitvector &res, uint32_t b) const |
| Compute the bitvector that is the answer for the query x >= b. | |
| virtual size_t | getSerialSize () const throw () |
| Estimate the size of the index in a file. | |
| int | write32 (int fdes) const |
| Write the content to a file opened by the caller. More... | |
| int | write64 (int fdes) const |
| Write the content to a file opened by the caller. More... | |
Static Protected Member Functions inherited from ibis::relic | |
| template<typename T > | |
| static long | mergeValuesT (const array_t< T > &vs, const array_t< const bitvector * > &ps, array_t< T > &res) |
Protected Attributes inherited from ibis::skive | |
| array_t< uint32_t > | cnts |
The bit-sliced index.
This version strictly slices the binary bits of the incoming values. It also supports operations on bit slices.
| ibis::slice::slice | ( | const ibis::column * | c, |
| ibis::fileManager::storage * | st, | ||
| size_t | start = 8 |
||
| ) |
Reconstruct from content of a storage object.
The content of the file (following the 8-byte header) is
References ibis::index::bits, ibis::index::col, ibis::gVerbose, ibis::column::name(), ibis::part::name(), ibis::index::nrows, print(), and ibis::array_t< T >::size().
|
static |
Are values of the given column suitable for a bit-sliced index? Returns true for yes.
The bit-sliced index can only be used for unsigned integers. This function will return false if the column type is not integer or the integer values are not all non-negative.
References ibis::column::isSignedInteger(), ibis::column::isUnsignedInteger(), ibis::column::lowerBound(), and ibis::column::upperBound().
Referenced by slice().
|
inlinevirtual |
Returns the name of the index, similar to the function type, but returns a string instead.
Reimplemented from ibis::skive.
|
virtual |
Write the content of the index to the specified location.
The actual index file name is determined by the function indexFileName.
Reimplemented from ibis::skive.
References ibis::fileManager::flushFile(), ibis::gVerbose, ibis::fileManager::instance(), ibis::index::SLICE, and UnixOpen.
|
| |