Query the movie with a rate is very slow

I would like to query all the movies that actor_name is “dengchao” and the rate is greater than or equal to 7.0. However, total time spends about 800ms. It is very slow, what is the problem ? When I remove the filter function, total time spends only about 9ms.

The query is like this:

  node(func: eq(actor_name,"dengchao"))@cascade {
    ~actor @filter(ge(rate,7.0)){

The schema is like this:

<actor>: uid @reverse .
<actor_name>: string @index(hash) .
<rate>: float @index(float) .
<title>: string @index(term) .

This is hard to tell by a single query and schema. A real-world replication would be better.

See, in https://docs.dgraph.io/ we have a simple cluster configuration. And we can run all of the queries in the docs with millions of nquads. If you find a similar query in the documentation with the same problem. It would be easy for us to keep up.

What may be happening to you are numerous factors. I would recommend that you use Jaeger. To trace the source of the problem. Although a bit complicated, it is the best tool for finding bottlenecks and thus helping to better understand this problem.

Donwload it https://www.jaegertracing.io/ and run:


./dgraph zero --jaeger.collector=http://localhost:14268 --expose_trace
./dgraph alpha --lru_mb 8000 --jaeger.collector=http://localhost:14268 --expose_trace

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.