-
Notifications
You must be signed in to change notification settings - Fork 233
Description
When we add an index, it may alter the query plan of a query.For the same statement, the result should be the same regardless of whether an index is used. However, I found a logic bug in this case.
This is my cypher query:
MATCH (n1 :L1)-[r1 :T0]->(n2 :L4) WHERE ((n2.k28) < 'a') RETURN *
This is its query result:

Then I added this index:CREATE INDEX ON:L4(k28)
and executed the same query again,this is its result:

However, this issue doesn't occur every time—it only happens when adding the index causes the query plan to change. I used RedisInsight to examine the change in the query plan and found that the plan before and after adding the index changed in the following way:
Redis version: redis-7.2.4
RedisGraph version: redisgraph-2.12.10
Operating system: Ubuntu 20.04
Here is the dataset:

