Dgraph queries the shortest path between two nodes, and queries multiple relationships through numumpths, which is inefficient


Report a Dgraph Bug

What version of Dgraph are you using?

Dgraph Version
$ dgraph version
 
PASTE YOUR RESULTS HERE

Have you tried reproducing the issue with the latest release?

What is the hardware spec (RAM, OS)?

Steps to reproduce the issue (command/config used to run Dgraph).

Expected behaviour and actual result.


Experience Report for Feature Request

Note: Feature requests are judged based on user experience and modeled on Go Experience Reports. These reports should focus on the problems: they should not focus on and need not propose solutions.

What you wanted to do

What you actually did

Why that wasn’t great, with examples

Any external references to support your case

因为节点超过50万条节点,关系超过100万,通过 from to numpaths 查询所有关系时候,速度非常慢,该怎么解决。

Because the number of nodes exceeds 500,000 nodes and the relationship exceeds 1 million, when querying all relationships through from to numpaths, the speed is very slow, how to solve it.

I don’t know how to make the shortest path query performance any better than what it is. I am sorry.

With half a million nodes and a million edges between the nodes, it really depends on how deeply connected the data is to be honest. The more the data patterns hub and spoke, the more I would imagine the performance to degrade. If it was a really segregated dataset then the performance would probably be better.

That is just my thoughts on the matter. Do you know if you dataset is highly connected around centralized nodes?

Datasets are very closely related There may be more than 1 million edge relationships

I kind of expected that with your stated low performance.

I don’t know golang enough to work through how this works but the code is in dgraph/query.go at a22d7bd5c42855a6c10ad5caf1b80711406f6416 · dgraph-io/dgraph · GitHub I believe.