图形数据库性能 [英] Graph database performance

查看:204
本文介绍了图形数据库性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读Neo4j网站上推荐的一本书: http://neo4j.com/books/graph -databases/关于图形数据库的性能,它说:

I was reading a book recommended on Neo4j site: http://neo4j.com/books/graph-databases/ about graph database performance and it said:

"与关系数据库相反,在关系数据库中,连接密集型查询的性能会下降 随着数据集变得更大,使用图数据库的性能趋于保持 相对恒定,即使随着数据集的增长也是如此.这是因为查询已本地化为 图形的一部分. 结果是,每个查询的执行时间仅是成比例的 为满足该查询而遍历的图形部分的大小,而不是 整体图表."

"In contrast to relational databases, where join-intensive query performance deteriorates as the dataset gets bigger, with a graph database performance tends to remain relatively constant, even as the dataset grows. This is because queries are localized to a portion of the graph. As a result, the execution time for each query is proportional only to the size of the part of the graph traversed to satisfy that query, rather than the size of the overall graph."

例如我只想返回标签为"Doctor"的节点,该标签已本地化到图形的一部分.但是我的问题是数据库本身如何知道这些节点在哪里?换句话说,不需要遍历所有节点来查找找出他们是否满足查询条件并据此做出决定?

So e.g. I want to return only nodes with a label "Doctor, that's localized to a portion of a graph. But my question is how does the database itself know where those nodes are ? In other words, does it not need to traverse all nodes to find out whether or not they satisfy the query and make decision based on that ?

推荐答案

通常来说,本地化搜索意味着:您从一组很小的起点开始,这些起点可以是人,产品,地点,订单等

In general localized searches mean: you start from a smallish set of starting points which can be people, products, places, orders etc.

图中带有标签注释的一部分通常不属于该类别,即所有医生都不是很小的起点.

A portion of the graph that is annotated with a label, often doesn't fall into that category, i.e. all doctors are not a smallish set of starting points.

如果您从所有医生到他们的邻居,您的查询可能会触及图表的很大一部分.

Your query would probably touch a large portion of the graph if you traverse out from all doctors to their neighborhoods.

这样的查询将是本地图:

A query like this would be a graph local one:

MATCH (:City {name:"SFO"})<-[:RESIDES_IN]-(d:Doctor)-[presc:PRESCRIBES]->(m:Medicine)
RETURN d.name, m.name, sum(presc.amount) as amount

这篇关于图形数据库性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆