Join the community at Nodes 2022, our free virtual event on November 16 - 17.
RETURN r.myProp as prop, count(r) as count
I'm wondering if there is a way to speed up this query. Currently with ~50 million relationships, it takes a long time.
welcome to the community!
Depends on the structure of your graph. My first hint would be to add a type to the relationship, cause I assume myProp doesn't appear on all types of relationships but on one or only a few.
MATCH (:A)-[r:REL_TYPE]->(:A) ...
or, if more than one type is needed:
MATCH (:A)-[r:REL_TYPE1|RELTYPE2]->(:A) ...