I have nodes with different labels and i want to let my customer to search by some identifier.
I have the labels: Person, Company, Factory - all have the 'id' property.
I i specify the label like: "MATCH (n:Person {id: '1234'}) .... It works great - 2 ms (i have indexes of 'id' on all labels).
But i want it to search all db and not only a specific label , so i wrote "MATCH (n{id: '1234'})... but it takes a few seconds.
Any advise what can i do to improve it?
Thanks,
@yanivts1
not much you can do as "MATCH (n{id: '1234'}) says find me a node, any node with any label an said node has a property named id and its value is 1234. If your graph has 100 milliion nodes then the query needs to read all 100 million nodes and then apply the filter of id=1234.
And as you saw indexes as based upon the 2 part combination of LABEL and PROPERTY(S).
I believe there are some label-using tactics. Assuming that 10,000 nodes of the same type are present in the Neo4j database. When labels are added to these nodes, the query will function more efficiently.
I hope this information will be useful to some people and I look forward to their feedback. I have learned the Salesforce CPQ Course. Therefore, your feedback is very valuable to further my career development whether good or bad.