1

我使用标签概念查询了与另一个类似的搜索元素:

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

“相似”是一组使用 type 属性索引的节点。“至”是我必须与“相似”节点进行比较的节点。

类似的查询本身返回 500 个节点,关系 TAGGED 的计数为 3000。标记节点为 500。在我的机器上,此查询需要 50 秒。

删除 order by 子句和/或 count 子句不会提高性能。

4

1 回答 1

0

Which version of Neo4j are you using? How do you execute the query (REST, web-console, shell, java)? Is this the first run in the session or the second or third?

Can you try to rewrite your match clause, so that to comes first? It shouldn't make a difference but would be interesting to know.

match to-[:TAGGED]->tag<-[:TAGGED]-similar

Thanks a lot.

于 2011-11-15T04:25:02.430 回答