8000 Bug fix/search 238 late materialization with constrained heap by Dronplane · Pull Request #14722 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Bug fix/search 238 late materialization with constrained heap #14722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add index case test
  • Loading branch information
Dronplane committed Sep 1, 2021
commit adfe931f7da93f1a6840efbf9a65e97d393a8e32
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,31 @@ function lateDocumentMaterializationRuleTestSuite () {
let result = AQL_EXECUTE(query);
assertEqual(1, result.json.length);
assertEqual(result.json[0]._key, 'c0');
},
testConstrainedSortOnDbServer() {
let query = "FOR d IN " + prefixIndexCollectionName + " FILTER d.obj.b == {sb: 'b_val_0'} " +
"SORT d.obj.b LIMIT 10 RETURN {key: d._key, value: d.some_value_from_doc}";
let plan = AQL_EXPLAIN(query).plan;
assertNotEqual(-1, plan.rules.indexOf(ruleName));
let materializeNodeFound = false;
let nodeDependency = null;
plan.nodes.forEach(function(node) {
if( node.type === "MaterializeNode") {
assertFalse(materializeNodeFound);
assertEqual(nodeDependency.type, isCluster ? "SortNode" : "LimitNode");
materializeNodeFound = true;
}
nodeDependency = node;
});
assertTrue(materializeNodeFound);
let result = AQL_EXECUTE(query);
assertEqual(1, result.json.length);
let expected = new Set(['c0']);
result.json.forEach(function(doc) {
assertTrue(expected.has(doc.key));
expected.delete(doc.key);
});
assertEqual(0, expected.size);
}
};
}
Expand Down
0