Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
09-06-2021 05:19 AM
I'm using Neo4j 3.5 enterprise version,
and I profiling the cypher below:
MATCH (J:Host) WHERE J.Status = "running" AND not (J)-->(:Ipv4 {Ipv4: "xxx"}) AND (J)<--(:Cluster {Name: "yyy"}) return J
The result of profiling looks like:
09-08-2021 04:24 AM
Hi @SgtDaJim ,
This should be bit better
MATCH (J:Host)<--(:Cluster {Name: "yyy"})
WHERE J.Status = "running"
with J where not (J)-->(:Ipv4 {Ipv4: "xxx"})
return J
Lemme know,
Bennu
09-08-2021 04:59 AM
giving @Bennu right.
Especially because property "Name" on Cluster and property "Ipv4" on Ipv4 are both indexed as unique, querying on them will reduce the hits at the quickest.
Therefore on an other way would be:
MATCH (:Ipv4 {Ipv4: "xxx"})<--(rejected:Host)-->(:Cluster {Name: "yyy"})-->(J:Host)
WHERE J.Status = "running"
return J
with this you get the "Host" around the named cluster separated in 2 parts: those which are aside the Ipv4 and the other.
We are curious about the profiling of Bennu's proposition and mine. Please post results.
All the sessions of the conference are now available online