1
0
Fork 0

Merge branch 'aql-jmmh-conditions' of github.com:arangodb/arangodb into aql-jmmh-conditions

This commit is contained in:
Michael Hackstein 2015-10-08 17:53:24 +02:00
commit 4d2383d0b6
4 changed files with 23 additions and 28 deletions

View File

@ -120,9 +120,6 @@ int IndexBlock::initialize () {
// instantiate expressions: // instantiate expressions:
auto instantiateExpression = [&] (size_t i, size_t j, size_t k, AstNode const* a) -> void { auto instantiateExpression = [&] (size_t i, size_t j, size_t k, AstNode const* a) -> void {
Expression* expression = nullptr;
{
// all new AstNodes are registered with the Ast in the Query // all new AstNodes are registered with the Ast in the Query
std::unique_ptr<Expression> e(new Expression(_engine->getQuery()->ast(), a)); std::unique_ptr<Expression> e(new Expression(_engine->getQuery()->ast(), a));
@ -132,8 +129,10 @@ int IndexBlock::initialize () {
_hasV8Expression |= e->isV8(); _hasV8Expression |= e->isV8();
_nonConstExpressions.emplace_back(i, j, k, e.get()); _nonConstExpressions.emplace_back(i, j, k, e.get());
expression = e.release();
} std::unordered_set<Variable const*> inVars;
e->variables(inVars);
e.release();
// Prepare _inVars and _inRegs: // Prepare _inVars and _inRegs:
_inVars.emplace_back(); _inVars.emplace_back();
@ -141,9 +140,6 @@ int IndexBlock::initialize () {
_inRegs.emplace_back(); _inRegs.emplace_back();
std::vector<RegisterId>& inRegsCur = _inRegs.back(); std::vector<RegisterId>& inRegsCur = _inRegs.back();
std::unordered_set<Variable const*> inVars;
expression->variables(inVars);
for (auto const& v : inVars) { for (auto const& v : inVars) {
inVarsCur.emplace_back(v); inVarsCur.emplace_back(v);
auto it = getPlanNode()->getRegisterPlan()->varInfo.find(v->id); auto it = getPlanNode()->getRegisterPlan()->varInfo.find(v->id);

View File

@ -65,10 +65,9 @@ namespace triagens {
size_t const operatorMember; size_t const operatorMember;
Expression* expression; Expression* expression;
NonConstExpression ( NonConstExpression (size_t orM,
size_t const orM, size_t andM,
size_t const andM, size_t opM,
size_t const opM,
Expression* exp) Expression* exp)
: orMember(orM), : orMember(orM),
andMember(andM), andMember(andM),

View File

@ -62,7 +62,7 @@ namespace triagens {
Collection const* collection, Collection const* collection,
Variable const* outVariable, Variable const* outVariable,
std::vector<Index const*> indexes, std::vector<Index const*> indexes,
Condition const* condition, Condition* condition,
bool reverse) bool reverse)
: ExecutionNode(plan, id), : ExecutionNode(plan, id),
_vocbase(vocbase), _vocbase(vocbase),
@ -198,7 +198,7 @@ namespace triagens {
/// @brief the index(es) condition /// @brief the index(es) condition
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
Condition const* _condition; Condition* _condition;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
/// @brief the index sort order - this is the same order for all indexes /// @brief the index sort order - this is the same order for all indexes

View File

@ -123,16 +123,16 @@ static bool IsEqualKeyElementHash (TRI_hash_index_search_value_t const* left,
TRI_doc_mptr_t* HashIndexIterator::next () { TRI_doc_mptr_t* HashIndexIterator::next () {
while (true) { while (true) {
if (_posInBuffer >= _buffer.size()) {
if (_position >= _keys.size()) { if (_position >= _keys.size()) {
// we're at the end of the lookup values // we're at the end of the lookup values
return nullptr; return nullptr;
} }
if (_posInBuffer >= _buffer.size()) {
// We have to refill the buffer // We have to refill the buffer
_buffer.clear(); _buffer.clear();
_posInBuffer = 0; _posInBuffer = 0;
int res = _index->lookup(_keys[_position++], _buffer); int res = _index->lookup(_keys[_position++], _buffer);
if (res != TRI_ERROR_NO_ERROR) { if (res != TRI_ERROR_NO_ERROR) {