Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-07-2021 01:04 PM
Hello,
I'm trying to see which cypher query will be faster.
For a case where I have several user nodes and I want to filter for users of a particular gender.
Will it be better/faster to have "gender" as a separate node and have different values as relationship-properties or to have the gender property on the "user" node.
02-07-2021 09:17 PM
Loading properties is expensive, traversing is cheap. The faster option will be the relationship
02-08-2021 03:41 AM
Thank you very much.
02-08-2021 09:07 PM
One trick a lot of people don't know about, is that Nodes can have multiple Labels.
So, you can do:
CREATE(p:Person:Male {name:"Adam"});
CREATE(p:Person:Female {name:"Eve"})
If you want to match for all Women:
MATCH(women:Female) WHERE ....
The performance advantage of this, is all nodes with the label Female (or Male) is a set, so accessing all the Female nodes is very quick.
All the sessions of the conference are now available online