cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Returning count much faster than the nodes

russ
Node Link

I realise this may be a newbie 101 question so please bear with me.

I've noticed that my slowest queries, which take minutes to return 2K + nodes take a few seconds if I'm only counting the results. Is this due to the memory overhead of loading the nodes into RAM? I assumed the times would be similar - that the time would be spent in the plan execution - not in returning the results? I'd be grateful to know what's the general cause for this difference.

Btw, I've been reading the pinned articles in the meantime on tuning (many thanks).

Thanks in advance
Russ

1 ACCEPTED SOLUTION

Thanks for the tips, Stefan. I've started using the shell now - I can see what you mean by the speed.

View solution in original post

2 REPLIES 2

Depending on the type of query the "count store" might hook in. Count store "knows" how many nodes by label you have and couple of more information.
Another reason is that returning nodes utilizes more network bandwidth than just returning a number.
Neo4j browser rendering sometimes gives you a misleading impression regarding query speed, for testing speed cypher-shell is the better tool.

Thanks for the tips, Stefan. I've started using the shell now - I can see what you mean by the speed.