mirror of https://gitee.com/bigwinds/arangodb
do not prefer primary indexes in that many situations
This commit is contained in:
parent
e58080eb1b
commit
9f101ae20f
|
@ -65,8 +65,15 @@ bool SimpleAttributeEqualityMatcher::matchOne(
|
|||
// we can use the index
|
||||
// use slightly different cost calculation for IN than for EQ
|
||||
calculateIndexCosts(index, itemsInIndex, estimatedItems, estimatedCost);
|
||||
estimatedItems *= op->getMember(1)->numMembers();
|
||||
estimatedCost *= op->getMember(1)->numMembers();
|
||||
size_t values = 1;
|
||||
auto m = op->getMember(1);
|
||||
if (m->isArray() && m->numMembers() > 1) {
|
||||
// attr IN [ a, b, c ] => this will produce multiple items, so count
|
||||
// them!
|
||||
values = m->numMembers();
|
||||
}
|
||||
estimatedItems *= values;
|
||||
estimatedCost *= values;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue