#include <query.h>

Public Types | |
| enum | QUERY_STATE { UNINITIALIZED, SET_COMPONENTS, SET_RIDS, SET_PREDICATE, SPECIFIED, QUICK_ESTIMATE, FULL_EVALUATE, BUNDLES_TRUNCATED, HITS_TRUNCATED } |
Public Member Functions | |
| void | clear () |
| Releases the resources held by the query object and re-initialize the select clause and the where clause to blank. | |
| void | clearErrorMessage () const |
| Reset the last error message to blank. | |
| const selected & | components () const |
| Return a list of names specified in the select clause. | |
| void | contractQuery () |
| Contracts where clause to preferred bounds. | |
| long | countHits () const |
| Count the number of hits. | |
| const char * | dir () const |
| The query token. | |
| int | estimate () |
| Functions to perform estimation and retrieve range of hits Computes a lower and an upper bound of hits. | |
| int | evaluate (const bool evalSelect=false) |
| Computes the exact hits. | |
| void | expandQuery () |
| Expands where clause to preferred bounds. | |
| long | getExpandedHits (ibis::bitvector &) const |
| Get a bitvector containing all rows satisfying the query condition. | |
| const ibis::bitvector * | getHitVector () const |
| Return the pointer to the internal hit vector. | |
| const char * | getLastError () const |
| Return the last error message recorded internally. | |
| long | getMaxNumHits () const |
| Return the number of records in the upper bound. | |
| long | getMinNumHits () const |
| Return the number of records in the lower bound. | |
| long | getNumHits () const |
| Return the number of records in the exact solution. | |
| array_t< double > * | getQualifiedDoubles (const char *column_name) |
| array_t< float > * | getQualifiedFloats (const char *column_name) |
| array_t< int32_t > * | getQualifiedInts (const char *column_name) |
The functions getQualifiedXXX return the values of selected columns in the records that satisfies the specified conditions. | |
| array_t< uint32_t > * | getQualifiedUInts (const char *column_name) |
| RIDSet * | getRIDs (const ibis::bitvector &mask) const |
| Return a list of row ids that match the mask. | |
| RIDSet * | getRIDs () const |
| Return the list of row IDs of the hits. | |
| const RIDSet * | getRIDsInBundle (const uint32_t bid) const |
| Return the list of row IDs of the hits within the specified bundle. | |
| virtual const char * | getSelectClause () const |
| Return the select clause string. | |
| QUERY_STATE | getState () const |
| Return the current state of query. | |
| const RIDSet * | getUserRIDs () const |
| Return a const pointer to the copy of the user supplied RID set. | |
| virtual const char * | getWhereClause () const |
| Return the where clause string. | |
| const char * | id () const |
| Functions about the identity of the query. | |
| long int | limit (const char *names, int direction, uint32_t keep, bool updateHits=true) |
| Truncate the bundles to provide the top-K rows of the bundles. | |
| void | logMessage (const char *event, const char *fmt,...) const |
| Used to print information about the progress or state of query processing. | |
| int | orderby (const char *names, int direction) const |
| Re-order the bundles according the the new "ORDER BY" specification. | |
| const part * | partition () const |
| Return the pointer to the data table used to process the query. | |
| void | printSelected (std::ostream &out) const |
| Print the values of the selected columns to the specified output stream. | |
| void | printSelectedWithRID (std::ostream &out) const |
| Print the values of the columns in the select clause without functions. | |
| query (const char *uid=0, const part *et=0, const char *pref=0) | |
| Constructor. Generates a new query on the given table et. | |
| query (const char *dir, const ibis::partList &tl) | |
| Constructor. | |
| RIDSet * | readRIDs () const |
| std::string | removeComplexConditions () |
| Separate out the sub-expressions that are not simple. | |
| long | sequentialScan (ibis::bitvector &bv) const |
| Return a (new) bitvector that contains the result of directly scan the raw data to determine what records satisfy the user specified conditions. | |
| int | setRIDs (const RIDSet &set) |
| Specifies a list of Row IDs for the query object to retrieve the records. | |
| virtual int | setSelectClause (const char *str) |
| Specifies the select clause for the query. | |
| int | setTable (const ibis::part *tbl) |
| Resets the table used to evaluate the query conditions to the table specified in the argument. | |
| int | setWhereClause (const ibis::qExpr *qexp) |
| Specify the where clause through a qExpr object. | |
| int | setWhereClause (const std::vector< const char * > &names, const std::vector< double > &lbounds, const std::vector< double > &rbounds) |
| Specify the where clause as a set of conjunctive ranges. | |
| int | setWhereClause (const char *str) |
| Specify the where clause in string form. | |
| time_t | timestamp () const |
| The time stamp on the data used to process the query. | |
| const char * | userName () const |
| User started the query. | |
| void | writeRIDs (const RIDSet *rids) const |
| template<> | |
| int64_t | countDeltaPairs (const array_t< int32_t > &val1, const array_t< uint32_t > &val2, const int32_t &delta) const |
| template<> | |
| int64_t | countDeltaPairs (const array_t< uint32_t > &val1, const array_t< int32_t > &val2, const uint32_t &delta) const |
| template<> | |
| int64_t | countEqualPairs (const array_t< uint32_t > &val1, const array_t< int32_t > &val2) const |
| template<> | |
| int64_t | countEqualPairs (const array_t< int32_t > &val1, const array_t< uint32_t > &val2) const |
| template<> | |
| int64_t | recordDeltaPairs (const array_t< int32_t > &val1, const array_t< uint32_t > &val2, const array_t< uint32_t > &ind1, const array_t< uint32_t > &ind2, const int32_t &delta, const char *filename) const |
| template<> | |
| int64_t | recordDeltaPairs (const array_t< uint32_t > &val1, const array_t< int32_t > &val2, const array_t< uint32_t > &ind1, const array_t< uint32_t > &ind2, const uint32_t &delta, const char *filename) const |
| template<> | |
| int64_t | recordEqualPairs (const array_t< int32_t > &val1, const array_t< uint32_t > &val2, const array_t< uint32_t > &ind1, const array_t< uint32_t > &ind2, const char *filename) const |
| template<> | |
| int64_t | recordEqualPairs (const array_t< uint32_t > &val1, const array_t< int32_t > &val2, const array_t< uint32_t > &ind1, const array_t< uint32_t > &ind2, const char *filename) const |
Static Public Member Functions | |
| static bool | isValidToken (const char *tok) |
| Is the given string a valid query token. | |
| static void | keepQueryRecords () |
| Tell the destructor to leave stored information on disk. | |
| static void | removeQueryRecords () |
| Tell the destructor to remove all stored information about queries. | |
| static unsigned | tokenLength () |
| Length of the query token. | |
Protected Member Functions | |
| void | addJoinConstraints (ibis::qExpr *&exp0) const |
| Add constraints derived from domains of the two join columns. | |
| int | computeHits () |
| template<typename T1, typename T2> | |
| int64_t | countDeltaPairs (const array_t< T1 > &val1, const array_t< T2 > &val2, const T1 &delta) const |
| Assume the two input arrays are sorted in ascending order, count the number of elements that are with delta of each other. | |
| template<typename T1, typename T2> | |
| int64_t | countEqualPairs (const array_t< T1 > &val1, const array_t< T2 > &val2) const |
| Assume the two input arrays are sorted in ascending order, count the number of elements that match. | |
| uint32_t | countPages (unsigned wordsize) const |
| int | doContract (ibis::qExpr *exp0) const |
| void | doEstimate (const qExpr *term, ibis::bitvector &low, ibis::bitvector &high) const |
| int | doEvaluate (const qExpr *term, const ibis::bitvector &mask, ibis::bitvector &hits) const |
| int | doEvaluate (const qExpr *term, ibis::bitvector &hits) const |
| int | doExpand (ibis::qExpr *exp0) const |
| int | doScan (const qExpr *term, ibis::bitvector &hits) const |
| int | doScan (const qExpr *term, const ibis::bitvector &mask, ibis::bitvector &hits) const |
| void | gainReadAccess (const char *mesg) const |
| void | gainWriteAccess (const char *mesg) const |
| void | getBounds () |
| bool | hasBundles () const |
| void | logError (const char *event, const char *fmt,...) const |
| void | logWarning (const char *event, const char *fmt,...) const |
| int64_t | mergePairs (const char *pairfile) const |
| void | orderPairs (const char *pairfile) const |
| Sort the content of the file as ibis::rid_t. | |
| void | printRIDs (const RIDSet &ridset) const |
| ibis::query::setMyDir | |
| int64_t | processJoin () |
| Process the join operation and return the number of pairs. | |
| void | readHits () |
| void | readQuery (const ibis::partList &tl) |
| template<typename T1, typename T2> | |
| int64_t | recordDeltaPairs (const array_t< T1 > &val1, const array_t< T2 > &val2, const array_t< uint32_t > &ind1, const array_t< uint32_t > &ind2, const T1 &delta, const char *pairfile) const |
| template<typename T1, typename T2> | |
| int64_t | recordEqualPairs (const array_t< T1 > &val1, const array_t< T2 > &val2, const array_t< uint32_t > &ind1, const array_t< uint32_t > &ind2, const char *pairfile) const |
| void | releaseAccess (const char *mesg) const |
| void | removeFiles () |
| void | reorderExpr () |
| int64_t | sortEquiJoin (const ibis::rangeJoin &cmp, const ibis::bitvector &mask, const char *pairfile) const |
| Perform equi-join by sorting the selected values. | |
| int64_t | sortEquiJoin (const ibis::rangeJoin &cmp, const ibis::bitvector &mask) const |
| Performing an equi-join by sorting the selected values first. | |
| int64_t | sortJoin (const ibis::rangeJoin &cmp, const ibis::bitvector &mask) const |
| int64_t | sortJoin (const std::vector< const ibis::rangeJoin * > &terms, const ibis::bitvector &mask) const |
| int64_t | sortRangeJoin (const ibis::rangeJoin &cmp, const ibis::bitvector &mask, const char *pairfile) const |
| Performing range join by sorting the selected values. | |
| int64_t | sortRangeJoin (const ibis::rangeJoin &cmp, const ibis::bitvector &mask) const |
| Performing a range join by sorting the selected values. | |
| int | verifyPredicate (qExpr *&qexpr) |
| void | writeHits () const |
| virtual void | writeQuery () |
Protected Attributes | |
| selected | comps |
| Names of selected components. | |
| char * | condition |
| Query condition (string). | |
| ibis::part::readLock * | dslock |
| A read lock on the table0. | |
| ibis::bitvector * | hits |
| Solution in bitvector form (or lower bound). | |
| char | lastError [MAX_LINE+PATH_MAX] |
| The warning/error message. | |
| QUERY_STATE | state |
| Status of the query. | |
| ibis::bitvector * | sup |
| Estimated upper bound. | |
| char * | user |
| Name of the user who specified the query. | |
Friends | |
| class | readLock |
| class | writeLock |
Classes | |
| class | readLock |
| class | result |
| The class ibis::query::result allows user to retrieve query result one row at a time. More... | |
| class | weight |
| class | writeLock |
This is the primary entry for user to take advantage of bitmap indexing facilities. A query is a very limited version of the SQL SELECT statement. It is only defined on one table and it takes a where clause and a select clause. The where clause is mandatory. It contains a list of range conditions joined together with logical operators, such as "temperature > 700 and 100 <= presessure < 350". Records whose attribute values satisfy the conditions defined in the where clause is considered hits. A query may retrieve values of variables/columns specified in the select clause. A select clause is optional. If specified, it contains a list of column names. These attributes must not be NULL in order for a record to be a hit. The select clause may also contain column names appearing as the argument to one of the four functions: avg, max, min and sum. For example, "temperature, pressure, average(ho2_concentration)" may be a select statement for a Chemistry application.
The hits can be computed in two ways by using functions estimate or evaluate. The function estimate can take advantage of the indices to give two approximate solutions, one as an upper bound and the other as a lower bound. The bitmap indices will be automatically built according to the specification if they are not present. The accuracy of the bounds depend on the nature of the indices available. If no index can be constructed, the lower bound would be empty and the upper bound would include every record. When the function evaluate is called, the exact solution is computed no matter whether the function estimate has been called or not. The solution produced is recorded as a bit vector. The user may use ibis::bitvector::indexSet to extract the record numbers of the hits or use one of the functions getQualifiedInts, getQualifiedFloats, and getQualifiedDoubles to retrieve the values of the selected attributes. Additionally, one may call either printSelected or printSelectedWithRID to print the selected values to the specified I/O stream.
| ibis::query::query | ( | const char * | dir, | |
| const ibis::partList & | tl | |||
| ) |
Constructor.
Construct a query from the content stored in the named directory.
Reconstructs query from stored information in the named directory dir. This is only used for recovering from program crashes.
It is used to recover a query from crash, not intended for user to manually construct a query in a directory.
References comps, hits, ibis::selected::size(), state, and sup.
| ibis::query::query | ( | const char * | uid = 0, |
|
| const part * | et = 0, |
|||
| const char * | pref = 0 | |||
| ) |
Constructor. Generates a new query on the given table et.
Construct a query object from scratch.
If recovery is desired or the query objects has its own special prefix, a cache directory is created to store some information about the query such as the query conditions and the resulting solutions. The stored information enables it to be reconstructed in case of crash.
References ibis::gParameters(), ibis::gVerbose, and lastError.
| void ibis::query::clear | ( | ) |
Releases the resources held by the query object and re-initialize the select clause and the where clause to blank.
References ibis::selected::clear(), comps, condition, dslock, ibis::fileManager::flushDir(), ibis::gParameters(), ibis::gVerbose, hits, ibis::fileManager::instance(), logMessage(), and sup.
| void ibis::query::contractQuery | ( | ) |
| int64_t ibis::query::countDeltaPairs | ( | const array_t< T1 > & | val1, | |
| const array_t< T2 > & | val2, | |||
| const T1 & | delta | |||
| ) | const [inline, protected] |
Assume the two input arrays are sorted in ascending order, count the number of elements that are with delta of each other.
Note that both template arguments should be elemental types or they must support operators -, +, == and < with mixed types.
References ibis::util::logger::buffer(), countEqualPairs(), and array_t< T >::size().
Referenced by sortRangeJoin().
| int64_t ibis::query::countEqualPairs | ( | const array_t< int32_t > & | val1, | |
| const array_t< uint32_t > & | val2 | |||
| ) | const [inline] |
This is an explicit specialization of a protected member of ibis::query class.
References array_t< T >::back(), array_t< T >::find(), array_t< T >::front(), and array_t< T >::size().
| int64_t ibis::query::countEqualPairs | ( | const array_t< T1 > & | val1, | |
| const array_t< T2 > & | val2 | |||
| ) | const [inline, protected] |
Assume the two input arrays are sorted in ascending order, count the number of elements that match.
Note that both template arguments should be elemental types or they must support operators == and < with mixed types.
References ibis::gVerbose, and array_t< T >::size().
Referenced by countDeltaPairs(), and sortEquiJoin().
| long ibis::query::countHits | ( | ) | const |
Count the number of hits.
Don't generate the hit vector if not already there.
References ibis::bitvector::cnt(), ibis::part::countHits(), ibis::qExpr::getType(), hits, ibis::part::nRows(), and sup.
| const char* ibis::query::dir | ( | ) | const [inline] |
The query token.
For persistent data
Referenced by ibis::bundles::write(), and ibis::bundle1::write().
| int ibis::query::estimate | ( | ) |
Functions to perform estimation and retrieve range of hits Computes a lower and an upper bound of hits.
This is done by using the indices. If possible it will build new indices. The lower bound contains only records that are hits and the upper bound contains all hits but may also contain some records that are not hits. Returns 0 for success, a negative value for error.
References ibis::bitvector::bytes(), ibis::bitvector::cnt(), comps, condition, ibis::horometer::CPUTime(), ibis::qExpr::directEval(), dslock, ibis::selected::empty(), ibis::gVerbose, ibis::qExpr::hasJoin(), hits, ibis::fileManager::instance(), logMessage(), ibis::part::nColumns(), ibis::part::nRows(), ibis::fileManager::pageCount(), ibis::horometer::realTime(), ibis::bitvector::set(), ibis::bitvector::size(), ibis::horometer::start(), state, ibis::horometer::stop(), sup, ibis::part::timestamp(), and ibis::bad_alloc::what().
Referenced by ibis::mensa::estimate(), ibis::bord::estimate(), processJoin(), and removeComplexConditions().
| int ibis::query::evaluate | ( | const bool | evalSelect = false |
) |
Computes the exact hits.
The same answer shall be computed whether there is any index or not. The argument evalSelect indicates whether the select clause should be evaluated at the same time. If its value is true, the columns specified in the select clause will be retrieved from disk and stored in the temporary location for this query. If not, the qualified values will be retrieved from disk when one of getRIDs, getQualifiedInts, getQualifiedFloats, and getQualifiedDoubles is issued. In the later case, only the specified column is retrieved. In addition, the values of column at the time of the function are read, which can be potentially different different from the time when the function evaluate was called.
Returns 0 for success, a negative value for error.
References ibis::bitvector::bytes(), ibis::bitvector::clusteringFactor(), ibis::bitvector::cnt(), comps, condition, ibis::horometer::CPUTime(), ibis::bundle::create(), dslock, ibis::selected::empty(), ibis::gVerbose, ibis::qExpr::hasJoin(), hits, ibis::fileManager::instance(), logMessage(), ibis::part::name(), ibis::part::nColumns(), ibis::part::nRows(), ibis::fileManager::pageCount(), ibis::fileManager::pageSize(), processJoin(), ibis::bitvector::randomSize(), ibis::horometer::realTime(), array_t< T >::size(), ibis::selected::size(), ibis::bitvector::size(), ibis::horometer::start(), state, ibis::horometer::stop(), sup, ibis::part::timestamp(), user, ibis::bad_alloc::what(), and ibis::bundle::write().
Referenced by ibis::mensa::computeHits(), ibis::bord::computeHits(), ibis::part::get1DDistribution(), ibis::part::get2DDistribution(), ibis::part::get3DDistribution(), ibis::part::getCumulativeDistribution(), ibis::part::getDistribution(), ibis::part::getJointDistribution(), getQualifiedInts(), limit(), ibis::part::old2DDistribution(), removeComplexConditions(), ibis::mensa::select(), ibis::bord::select(), and ibis::mensa::select2().
| void ibis::query::expandQuery | ( | ) |
| long ibis::query::getExpandedHits | ( | ibis::bitvector & | res | ) | const |
Get a bitvector containing all rows satisfying the query condition.
The resulting bitvector inculdes both active rows and inactive rows.
References ibis::bitvector::clear(), ibis::bitvector::cnt(), and ibis::part::evaluateRIDSet().
Referenced by ibis::part::stringToBitvector().
| const ibis::bitvector* ibis::query::getHitVector | ( | ) | const [inline] |
Return the pointer to the internal hit vector.
The user should NOT attempt to free the returned pointer.
Referenced by ibis::part::get1DDistribution(), ibis::part::get2DDistribution(), ibis::part::get3DDistribution(), ibis::part::getCumulativeDistribution(), ibis::part::getDistribution(), ibis::part::getJointDistribution(), ibis::part::old2DDistribution(), ibis::mensa::select(), ibis::bord::select(), and ibis::mensa::select2().
| array_t< int32_t > * ibis::query::getQualifiedInts | ( | const char * | column_name | ) |
The functions getQualifiedXXX return the values of selected columns in the records that satisfies the specified conditions.
The caller must call the operator delete to free the pointers returned.
evaluate was called. In other word, they may be inconsistent with the conditions specified in the where clause. For append-only data, this is NOT an issue.References evaluate(), ibis::gVerbose, hits, logMessage(), ibis::part::selectInts(), array_t< T >::size(), state, and ibis::part::timestamp().
| ibis::RIDSet * ibis::query::getRIDs | ( | const ibis::bitvector & | mask | ) | const |
Return a list of row ids that match the mask.
The user is responsible for freeing the pointer.
References ibis::bitvector::cnt(), ibis::part::getRIDs(), ibis::gVerbose, ibis::part::hasRIDs(), logMessage(), ibis::part::name(), and array_t< T >::size().
| ibis::RIDSet * ibis::query::getRIDs | ( | ) | const |
Return the list of row IDs of the hits.
The user is responsible for freeing the pointer.
References ibis::bitvector::cnt(), array_t< T >::deepCopy(), ibis::part::getRIDs(), ibis::gVerbose, ibis::part::hasRIDs(), hits, logMessage(), array_t< T >::size(), state, and ibis::part::timestamp().
| bool ibis::query::isValidToken | ( | const char * | tok | ) | [static] |
Is the given string a valid query token.
Return true if it has the expected token format, otherwise false.
References ibis::gVerbose, and tokenLength().
| long int ibis::query::limit | ( | const char * | names, | |
| int | direction, | |||
| uint32_t | keep, | |||
| bool | updateHits = true | |||
| ) |
Truncate the bundles to provide the top-K rows of the bundles.
It returns the number of results kept, which is the smaller of the current number of bundles and the input argument keep. A negative value is returned in case of error, e.g., query has not been fully specified. If the second argument is true, the internal hit vector is updated to match the truncated solution. Otherwise, the internal hit vector is left unchanged. Since the functions getNumHits and getQualifiedXXX uses this internal hit vector, it is generally a good idea to update the hit vector. On the other hand, one may wish to avoid this update if the hit vector is not used in any way.
References ibis::horometer::CPUTime(), ibis::bundle::create(), evaluate(), ibis::part::evaluateRIDSet(), ibis::bundle::getRIDs(), ibis::gVerbose, hits, logMessage(), ibis::horometer::realTime(), ibis::bundle::size(), ibis::horometer::start(), state, ibis::horometer::stop(), ibis::bundle::truncate(), and ibis::bundle::write().
| void ibis::query::logMessage | ( | const char * | event, | |
| const char * | fmt, | |||
| ... | ||||
| ) | const |
Used to print information about the progress or state of query processing.
It prefixes each message with a query token.
Referenced by clear(), ibis::bundle::create(), estimate(), evaluate(), getMaxNumHits(), getMinNumHits(), getNumHits(), getQualifiedInts(), getRIDs(), getRIDsInBundle(), getState(), limit(), orderby(), orderPairs(), processJoin(), removeComplexConditions(), sequentialScan(), setRIDs(), setSelectClause(), setTable(), setWhereClause(), sortEquiJoin(), and sortRangeJoin().
| int ibis::query::orderby | ( | const char * | names, | |
| int | direction | |||
| ) | const |
Re-order the bundles according the the new "ORDER BY" specification.
It returns 0 if it completes successfully. It returns a negative number to indicate error. If direction >= 0, sort the values in ascending order, otherwise, sort them in descending order.
References ibis::horometer::CPUTime(), ibis::bundle::create(), ibis::gVerbose, logMessage(), ibis::horometer::realTime(), ibis::bundle::reorder(), ibis::horometer::start(), state, ibis::horometer::stop(), and ibis::bundle::write().
| void ibis::query::orderPairs | ( | const char * | pfile | ) | const [protected] |
Sort the content of the file as ibis::rid_t.
It reads the content of the file one block at a time during the initial sorting of the blocks. It then merges the sorted blocks to produce a overall sorted file. Note that ibis::rid_t is simply a pair of integers. Sinc the pairs are recorded as pairs of integers too, this should work.
References ibis::fileManager::bytesFree(), ibis::gVerbose, ibis::fileManager::instance(), logMessage(), and PREFERRED_BLOCK_SIZE.
| void ibis::query::printRIDs | ( | const RIDSet & | ridset | ) | const [protected] |
ibis::query::setMyDir
This function prints a list of RIDs to the log file.
References array_t< T >::begin(), ibis::util::logger::buffer(), ibis::gVerbose, and array_t< T >::size().
| void ibis::query::printSelected | ( | std::ostream & | out | ) | const |
Print the values of the selected columns to the specified output stream.
The printed values are grouped by the columns without functions. For each group, the functions are evaluated on the columns named in the function. This is equivalent to have implicit "GROUP BY" and "ORDER BY" keywords on all columns appears without a function in the select clause.
References ibis::bitvector::cnt(), comps, ibis::bundle::create(), ibis::selected::empty(), hits, ibis::bundle::print(), state, and ibis::bundle::write().
| void ibis::query::printSelectedWithRID | ( | std::ostream & | out | ) | const |
Print the values of the columns in the select clause without functions.
One the groups of unique values are printed. For each group, the row ID (RID) of the rows are also printed.
References ibis::bitvector::cnt(), ibis::bundle::create(), hits, ibis::bundle::printAll(), state, and ibis::bundle::write().
| int64_t ibis::query::processJoin | ( | ) | [protected] |
Process the join operation and return the number of pairs.
This function only counts the number of hits; it does produce the actual tuples for the results of join.
Additionally, it performs only self-join, i.e., join a table with itself. This is only meant to test some algorithms for evaluating joins.
References ibis::index::BINNING, ibis::util::logger::buffer(), ibis::bitvector::bytes(), ibis::fileManager::bytesFree(), ibis::fileManager::bytesInUse(), ibis::bitvector64::clear(), ibis::bitvector::clusteringFactor(), ibis::bitvector64::cnt(), ibis::bitvector::cnt(), ibis::horometer::CPUTime(), ibis::compRange::barrel::equivalent(), estimate(), ibis::part::evaluateJoin(), ibis::bitvector64::firstIndexSet(), ibis::part::getColumn(), ibis::column::indexLock::getIndex(), ibis::column::getNullMask(), ibis::gVerbose, hits, ibis::bitvector::indexSet::indices(), ibis::bitvector::indexSet::isRange(), logMessage(), ibis::bitvector64::markovSize(), ibis::column::name(), ibis::part::name(), ibis::compRange::barrel::name(), ibis::bitvector::indexSet::nIndices(), ibis::part::nRows(), ibis::outerProduct(), ibis::horometer::realTime(), ibis::compRange::barrel::recordVariable(), ibis::index::RELIC, ibis::bitvector64::set(), ibis::bitvector::size(), ibis::bitvector64::size(), ibis::compRange::barrel::size(), ibis::horometer::start(), ibis::horometer::stop(), sup, ibis::bitvector64::swap(), and ibis::index::type().
Referenced by evaluate().
| std::string ibis::query::removeComplexConditions | ( | ) |
Separate out the sub-expressions that are not simple.
Separate the simple range conditions from the more complex ones.
This is intended to allow the overall where clause to be evaluated in separated steps, where the simple conditions are left for this software to handle and the more complex ones are to be handled by another software. The set of conditions remain with this query object and the conditions returned by this function are assumed to be connected with the operator AND. If the top-most operator in the WHERE clause is not an AND operator, the whole clause will be returned if it contains any conditions that is not simple, otherwise, an empty string will be returned.
Reset the where clause to the contain only the simple conditions. The more complex conditions are return in a string.
References condition, estimate(), evaluate(), ibis::gVerbose, hits, logMessage(), ibis::part::nRows(), ibis::qExpr::print(), ibis::qExpr::separateSimple(), ibis::bitvector::set(), setWhereClause(), state, and sup.
| long ibis::query::sequentialScan | ( | ibis::bitvector & | bv | ) | const |
Return a (new) bitvector that contains the result of directly scan the raw data to determine what records satisfy the user specified conditions.
It is mostly used for testing purposes. It can be called any time after the where clause is set, and does not change the state of the current query.
References ibis::util::logger::buffer(), ibis::bitvector::clear(), ibis::bitvector::cnt(), ibis::bitvector::copy(), ibis::horometer::CPUTime(), ibis::bitvector::firstIndexSet(), ibis::part::getMask(), ibis::gVerbose, hits, ibis::bitvector::indexSet::indices(), ibis::bitvector::indexSet::isRange(), logMessage(), ibis::bitvector::indexSet::nIndices(), ibis::part::nRows(), ibis::horometer::realTime(), ibis::horometer::start(), state, ibis::horometer::stop(), and ibis::bad_alloc::what().
| int ibis::query::setRIDs | ( | const RIDSet & | set | ) |
Specifies a list of Row IDs for the query object to retrieve the records.
References array_t< T >::begin(), comps, array_t< T >::deepCopy(), array_t< T >::empty(), array_t< T >::end(), ibis::gVerbose, hits, logMessage(), array_t< T >::size(), ibis::selected::size(), state, and sup.
| int ibis::query::setSelectClause | ( | const char * | str | ) | [virtual] |
Specifies the select clause for the query.
The select clause is a string of attribute names (plus the four predefined f