I'm using the latest ArangoDB of the respective release series:
Mode:
Storage-Engine:
On this operating system:
I'm issuing AQL via:
I've run db._explain("<my aql query>") and it didn't shed more light on this.
The AQL query in question is:
FOR r IN coll
RETURN COUNT(
FOR rr IN coll2
FILTER rr.a == true &&
r.id IN rr.b &&
r.id IN rr.c
RETURN null
)
The issue can be reproduced using this dataset:
dump.zip
These are the steps to reproduce:
1) open the browser on http://127.0.0.1:8529
2) log in as root/root
3) use database [ ] _system [x ] other: test
4) go to queries, run query above. Given the dataset, you would expect 0 returned, instead you have 1. You notice using explain that the index is used on a,b[] but no filter on c.
5) delete the index, run the query again, now you get 0 (the expected result)
6) Recreate a non unique non sparse hash index in coll2 on a,b[]
7) Run query :
FOR rr IN coll2
FILTER rr.a == true &&
3 IN rr.b &&
3 IN rr.c
RETURN null
8) You get no result, as expected. Explaining the query, you notice that the index is used but that an additional expression is created to filter on field c, which gives the correct result.
Therefore the problem seems to happen only when the collection is queried indirectly. Looks like a bug to me.
PS. I also created a stackoverflow question yesterday: https://stackoverflow.com/q/49372484/258542
Thanks!
Should be fixed by https://github.com/arangodb/arangodb/pull/4918
Thanks. Any idea when we can expect a release that includes this fix?
I have no ETA yet, but we normally release at least once every 2 weeks. And the last release has been mid-last week. So it shouldn't take too long.