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
Neo4j 编写密码查询的最佳方法_Neo4j_Cypher - Fatal编程技术网

Neo4j 编写密码查询的最佳方法

Neo4j 编写密码查询的最佳方法,neo4j,cypher,Neo4j,Cypher,我一直在尝试我的简单密码,以减少数据库命中率 PROFILE MATCH (origin:CS_LOCATION), (destination:CS_LOCATION) WHERE origin.location_id in[635] AND destination.location_id in[1104642] RETURN origin, destination; 在这里,我看到引用了两次CS_位置,并看到它执行了两次DB命中。我是否可以重写密码,使CS_位置的第二次引用从缓存中读取它?

我一直在尝试我的简单密码,以减少数据库命中率

PROFILE MATCH (origin:CS_LOCATION), (destination:CS_LOCATION)
WHERE origin.location_id in[635] AND destination.location_id in[1104642] 
RETURN origin, destination;

在这里,我看到引用了两次CS_位置,并看到它执行了两次DB命中。我是否可以重写密码,使CS_位置的第二次引用从缓存中读取它?

期望在获得不同的第一个节点后,缓存中会出现任意第二个节点是不合理的


旁白:您的查询实际上总共执行了4 DB的点击。

请花点时间阅读帮助中心中的。堆栈溢出上的格式与其他站点上的格式不同。您的帖子越好看,其他人就越容易阅读和理解。配置文件匹配(origin:CS_LOCATION),(destination:CS_LOCATION)其中origin.LOCATION_id在[635]中,destination.LOCATION_id在[1104642]中返回origin,destinationCYPHER不是SQL。第二个引用似乎正在访问不同的节点,假设
位置\u id
是唯一的。所以缓存可能不是您想要的。尝试将其拆分为两个查询,然后查看得到的结果<代码>配置文件匹配(原点:CS_位置),其中[635]中的origin.LOCATION_id返回原点等。
-------------------+----------------+------+---------+-----------+---------------------+---------------------------+
| Operator          | Estimated Rows | Rows | DB Hits | Cache H/M | Identifiers         | Other                     |
+-------------------+----------------+------+---------+-----------+---------------------+---------------------------+
| +ProduceResults   |            625 |    1 |       0 |       0/0 | destination, origin |                           |
| |                 +----------------+------+---------+-----------+---------------------+---------------------------+
| +CartesianProduct |            625 |    1 |       0 |       0/0 | destination, origin |                           |
| |\                +----------------+------+---------+-----------+---------------------+---------------------------+
| | +NodeIndexSeek  |             25 |    1 |       2 |       0/0 | destination         | :CS_LOCATION(location_id) |
| |                 +----------------+------+---------+-----------+---------------------+---------------------------+
| +NodeIndexSeek    |             25 |    1 |       2 |       0/0 | origin              | :CS_LOCATION(location_id) |
+-------------------+----------------+------+---------+-----------+---------------------+---------------------------+