agensgraph
agensgraph copied to clipboard
Bug in pattern matching with multiple relations
Agensgraph version: 2.13.0
Operating system: (Windows 11)
API/Driver: (psycopg2 2.9.7)
Steps to reproduce
As shown in this picture, query 1 aims to return the count of all nodes going out through the "et0" relationship and returning through the "et3" relationship. Neo4j returns 28, while Agensgraph strangely returns a very large value, 2695, because the total number of nodes in the graph is only 100. Query 2 returns the count of nodes going out through the "et0" relationship, and query 3 returns the count of nodes returning through the "et3" relationship. The results of these two queries on both graph database engines are consistent, but we found that the product of the results of queries 2 and 3 equals the result of query 1. From this, we can infer that Agensgraph, when using the above pattern to match multiple relationships, does not consider these relationships simultaneously but matches them separately. Finally, it returns the results in a manner similar to a Cartesian product, leading to a bug.