Which is more efficient, using properties or traversing relationship?

We are importing properties from which we can infer relationships. We then create these relationships. So now we have BOTH a property and a relationship that contain the SAME semantics.

My question is if you have both, is it more efficient to query
MATCH (o:TYPE)
MATCH (d:ANOTHERTYPE {property:o.value})//query selecting property value
or
MATCH (o:TYPE)-[r:REL]-(d:ANOTHERTYPE) //query traversing relationship to return the same target

TIA,
Paolo

Traversing through relationships will always be faster in neo4j .
As it is designed to the core to support that.

You can watch this video for the details :

1 Like

Thanks, @aman.negi,
The video helps, and my understanding has improved. I was very interested in the "flights" model, but the video kept showing the wrong slide so I couldn't match the words Max was saying to the diagram of the model he was creating. Is that model described anywhere else?

Paolo

Hey @pcantoni ,

I am sorry but I am also new to neo4j. So I do not know any reference to that model. It might be in their blogs or Max's own personal blog. You could check it out.

Regards,
Aman

Try this:

Thanks, @glilienfield,
Now Max's words make sense! Luckily, what I thought he we saying was borne out by the models in this article, so that's good news!

Paolo

1 Like