Monthly Archives: October 2017

Counting Nodes with Multiple Labels

We have over 6000 users in our #neo4j-users slack channel and get all kinds of requests. About a month ago Thomas Shields asked:

Should counting the set of things with 2 labels really take so long? I’ve got 48M nodes with LabelA and LabelB and the query `MATCH (n:LabelA:LabelB) RETURN COUNT(n)` is taking 80-90 seconds

Let’s see what’s going on by creating a small version of his graph. We will create 1M nodes of LabelA, then 1M nodes with both LabelA and LabelB, and then 1M nodes with just Label B:
Continue reading

Tagged , , , , , ,