I've have a query for search elements similar to another, using tag concepts:
START similar=node:TYPE_INDEX("type1"), to=node(20325)
match similar-[:TAGGED]->tag<-[:TAGGED]-to
return distinct similar, count(tag)
order by count(tag) DESC
"similar" is a set of node that are indexed using the type property. "To" is the node that I have to compare with "similar" nodes.
The similar query itself returns 500 nodes, and the count of relations TAGGED is 3000. Tag nodes are 500. On my machine this query takes 50secs.
Remove the order by clause and/or count clause not improve performance.