Describe the bug
During load testing, see #837, the docker logs from the memmachine-app container show repeated Neo4j performance notifications indicating potential inefficiency. The logs report that Cypher queries trigger cartesian product warnings due to disconnected patterns in the MATCH clause, which may cause excessive data generation and slowdowns during query processing.
Steps to reproduce
- Run MemMachine's load test suite or simulate bulk operations involving edge creation in Neo4j.
- Monitor the memmachine-app container logs.
- Observe
[INFO] neo4j.notifications lines with messages about cartesian products, example:
Received notification from DBMS server: <GqlStatusObject gql_status='03N90', status_description='info: cartesian product. The disconnected patterns ... build a cartesian product. A cartesian product may produce a large amount of data and slow down query processing.'> for query: 'UNWIND $edges AS edge\nMATCH (source:SANITIZED_Derivative... {uid: edge.source_uid}), (target:SANITIZED_Episode... {uid: edge.target_uid})\nCREATE (source) -[r:SANITIZED_DERIVED_FROM...]-> (target)\nSET r += edge.properties'
Expected behavior
Cypher queries should avoid producing cartesian products unless intended. Queries should match only related node pairs, and logs should not contain unexpected performance warnings. Overall load test performance should not be negatively impacted by inefficient query planning.
Environment
- OS: Linux
- MemMachine Version: (latest under load testing, specify exact version if available)
- Development language version: Python 3.x
- Database: Neo4j (version as configured for docker load tests)
Additional context
Docker logs from the memmachine-app container repeatedly show Neo4j cartesian product performance notifications like:
2026-01-06 22:47:07,920 [INFO] neo4j.notifications - Received notification from DBMS server: <GqlStatusObject gql_status='03N90', status_description='info: cartesian product. The disconnected patterns `(source:SANITIZED_Derivative_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_cc139ee1 {uid: edge.source_uid}), (target:SANITIZED_Episode_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_cc139ee1 {uid: edge.target_uid})` build a cartesian product. A cartesian product may produce a large amount of data and slow down query processing.', ...> for query: 'UNWIND $edges AS edge\nMATCH (source:SANITIZED_Derivative_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_cc139ee1 {uid: edge.source_uid}), (target:SANITIZED_Episode_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_cc139ee1 {uid: edge.target_uid})\nCREATE (source) -[r:SANITIZED_DERIVED_u5f_FROM_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_cc139ee1 {uid: edge.uid}]-> (target)\nSET r += edge.properties'
2026-01-06 22:47:07,921 [INFO] neo4j.notifications - Received notification from DBMS server: <GqlStatusObject gql_status='03N90', status_description='info: cartesian product. The disconnected patterns `(source:SANITIZED_Derivative_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_7e3661c7 {uid: edge.source_uid}), (target:SANITIZED_Episode_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_7e3661c7 {uid: edge.target_uid})` build a cartesian product. A cartesian product may produce a large amount of data and slow down query processing.', ...> for query: 'UNWIND $edges AS edge\nMATCH (source:SANITIZED_Derivative_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_7e3661c7 {uid: edge.source_uid}), (target:SANITIZED_Episode_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_7e3661c7 {uid: edge.target_uid})\nCREATE (source) -[r:SANITIZED_DERIVED_u5f_FROM_u5f_benchmark_u5f_org_u2f_benchmark_u5f_project_u5f_7e3661c7 {uid: edge.uid}]-> (target)\nSET r += edge.properties'
These appear after running bulk/batch ingestion and do not halt operation, but suggest query optimization opportunities.
Describe the bug
During load testing, see #837, the docker logs from the memmachine-app container show repeated Neo4j performance notifications indicating potential inefficiency. The logs report that Cypher queries trigger cartesian product warnings due to disconnected patterns in the MATCH clause, which may cause excessive data generation and slowdowns during query processing.
Steps to reproduce
[INFO] neo4j.notificationslines with messages about cartesian products, example:Expected behavior
Cypher queries should avoid producing cartesian products unless intended. Queries should match only related node pairs, and logs should not contain unexpected performance warnings. Overall load test performance should not be negatively impacted by inefficient query planning.
Environment
Additional context
Docker logs from the memmachine-app container repeatedly show Neo4j cartesian product performance notifications like:
These appear after running bulk/batch ingestion and do not halt operation, but suggest query optimization opportunities.