Can dgraph support execute plan?

Just like explain in SQL or other database system.
Can dgraph support query plan to show the cost of io or cpu of each function?
A query may be like this:

query {
   q(func: has(name)){
    uid
   }
}

The grammar I expect may like this:

explain {
 q(func: has(name)){
    uid
   }
}

Just replace the keyword query to explain.

1 Like

This is in our roadmap. But you can use Jaeger to get details about each operation if you are familiar with tracing.

Bearing in mind that using Jaeger, you will need to execute the query first. EXPLAIN in SQL doesn’t. It just prints out (in our equivalent) the subgraph and workers list.

thank you , I will try it later.

okay ,thanks .
I will try it later

Hi Michel,
I set up my Jaeger.
However, I can’t find any logs about Server.Query.

I’m pretty sure that you have traces of the query operation. But now, I don’t remember it from the top of my mind what are the values to follow. Tomorrow I can take a look (It is late here).

okay, thank you

Hey, I just find out (with @dmai’s help) what was the issue (I hope). I was getting the same behavior as yours on my machine. Using a Jaeger Darwin Binary. The issue is that Dgraph sends by default a sampling rate of 0.01 (1%) so you should increase it to 1. Which means 100%.

e.g:

dgraph alpha --jaeger.collector=http://localhost:14268 --trace=1

Now you should be able to see all operations traces right away.

Cheers.

thank you