Remember we talked about the Eager operator earlier in this chapter. We are importing US states with the LOAD CSV statement:
LOAD CSV WITH HEADERS FROM "file:///usa_state_neighbors_edges.csv" AS row FIELDTERMINATOR ';'
MERGE (n:State {code: row.code})
MERGE (m:State {code: row.neighbor_code})
MERGE (n)-[:SHARE_BORDER_WITH]->(m)
To better understand it and identify the root cause of this warning message, we ask Neo4j to EXPLAIN it. We would then get a complex diagram like the one displayed here:
I have highlighted three elements for you:
- The violet part corresponds to the first MERGE statement.
- The green part contains the same operations for the second MERGE statement.
- The read box is the Eager operation.
From this diagram, you can see that the Eager operation is performed between step 1 (the first MERGE) and step 2 (the second MERGE). This is where your query needs to be split in order to avoid this operator.
You now know more about how to understand...