Arangodb: Nested FOR query uses index but ignores other filters

Created on 20 Mar 2018  路  3Comments  路  Source: arangodb/arangodb

my environment running ArangoDB

I'm using the latest ArangoDB of the respective release series:

  • [x ] 3.2

Mode:

  • [x ] Single-Server

Storage-Engine:

  • [x ] mmfiles

On this operating system:

  • [x ] Windows, version:

this is an AQL-related issue:

I'm issuing AQL via:

  • [x ] web interface with this browser: chrome running on this OS: windows

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!

1 Bug 2 Fixed 3 AQL

All 3 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

caracal7 picture caracal7  路  3Comments

arturasjurev picture arturasjurev  路  3Comments

namnik picture namnik  路  3Comments

teamrehab picture teamrehab  路  3Comments

namnik picture namnik  路  3Comments