Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/neo4j/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Performance 密码性能-数据命中率与执行时间_Performance_Neo4j_Cypher - Fatal编程技术网

Performance 密码性能-数据命中率与执行时间

Performance 密码性能-数据命中率与执行时间,performance,neo4j,cypher,Performance,Neo4j,Cypher,在成功地使用spatial plugin实现所有功能后,我现在正在优化我的查询,以从中获得最佳效果 开始时,查询耗时约10秒 找到这个问题后, 我让查询在3秒钟内运行,但它仍然有140k个dbHits 我试图将查询分解成更多的匹配项,之后我得到了50k dbHits,但奇怪的是,执行时间实际上增加了 有人能解释一下dbHits和执行时间之间是否有直接关系吗 下面是我的查询示例(这是查询的一个简短版本,实际查询要大得多) START user=node(1),friend=node:userPos

在成功地使用spatial plugin实现所有功能后,我现在正在优化我的查询,以从中获得最佳效果

开始时,查询耗时约10秒

找到这个问题后, 我让查询在3秒钟内运行,但它仍然有140k个dbHits

我试图将查询分解成更多的匹配项,之后我得到了50k dbHits,但奇怪的是,执行时间实际上增加了

有人能解释一下dbHits和执行时间之间是否有直接关系吗

下面是我的查询示例(这是查询的一个简短版本,实际查询要大得多)

START user=node(1),friend=node:userPosition(“withindance:[0.003000,0.003000,10.000000]”)
其中friend.birthYear>=1952和friend.birthYear(:Language)(预期的blicator和回答者:答案{isonational:0}))(lang:Language)
与用户、朋友、朗
匹配(lang)(预期的通配符和回答者:答案{isOptional:0}))
与朋友、用户、期望的bligator和回答者

匹配(预期的bligator和swers)您是否验证了拆分第一个匹配可以提高性能?你试过扭转比赛的方向吗?有很多可能的排列。@JimBiard不,我没有用第一个来尝试,我的主要问题是,与更高的dbHits相比,减少dbHits是否总能让执行更快。
START user=node(1), friend=node:userPosition("withinDistance:[0.003000,0.003000,10.000000]") 
WHERE friend.birthYear >= 1952 AND friend.birthYear <= 1977
WITH DISTINCT friend, user
MATCH (user)-[:SPEAKS]->(:Language)<-[:SPEAKS]-(friend)
WITH friend, user
MATCH (user)-[:EXPECTS]->(expectedObligatoryAnswers:Answer {isOptional : 0}))<-[:ANSWERED]-(friend)
WITH friend, user,COUNT(DISTINCT expectedObligatoryAnswers.questionId) AS countExpectedObligatoryAnswers
WHERE (countExpectedObligatoryAnswers = 2)
RETURN friend
LIMIT 3;
MATCH (user)-[:SPEAKS]->(lang:Language)
WITH user, friend, lang
MATCH (lang)<-[:SPEAKS]-(friend)
WITH friend, user
MATCH (user)-[:EXPECTS]->(expectedObligatoryAnswers:Answer {isOptional : 0}))
WITH friend, user, expectedObligatoryAnswers
MATCH (expectedObligatoryAnswers)<-[:ANSWERED]-(friend)