While paging through the issues in the ArangoDB issue tracker I came across issue #987, titled “Trying to get distinct document attribute values from a large collection fails”.
The issue was opened around 10 months ago when ArangoDB 2.2 was around. We improved AQL performance somewhat since then, so I was eager to see how the query would perform in ArangoDB 2.6, especially when comparing it to 2.2.
For reproduction I quickly put together some example data to run the query on:
1 2 3 4 5 6 7 |
var db = require("org/arangodb").db; var c = db._create("test"); for (var i = 0; i < 4 * 1000 * 1000; ++i) { c.save({ _key: "test" + i, value: (i % 100) }); } require("internal").wal.flush(true, true); |