Last active
August 29, 2015 14:10
-
-
Save vranac/52f453c8194065c2236a to your computer and use it in GitHub Desktop.
Neo4j relationships
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE INDEX ON :Airport(IataCode); | |
CREATE INDEX ON :Deal(OriginId); | |
CREATE INDEX ON :Deal(DestinationId); | |
MATCH (ao:Airport),(d:Deal) | |
WHERE d.OriginId = ao.IataCode | |
MERGE (ao)-[ro:ORIGIN]->(d); | |
MATCH (ad:Airport),(d:Deal) | |
WHERE d.DestinationId = ad.IataCode | |
MERGE (d)-[rd:DESTINATION]->(ad); |
You should be able to profile both statements in neo4j-shell
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This should work better than the cross product:
same here: