Request for Comments
Similar to RFC: Is Mutation request really distributed?
One behavior I want to confirm is about computation in Dgraph’s query execution. With my time of experience, I noticed some inconsistencies in the execution. It is indeed distributed, but filters don’t appear to be. Which makes it difficult to execute complex queries.
In my observations, Dgraph asks the network for the predicates and their respective attributes. And then performs the filtering locally on the instance that it was requested (not on the client, on the DB node itself). Which can create a bottleneck. This increases CPU and memory consumption on a single instance.
PS. Math, aggregation and so on is part of computation.
Ideally, all filtering should be performed on the remote node beforehand and then returns the computed data. This will ensure a better response time from the cluster as a whole. Also avoiding OOM and CPU spikes.
Break the filters into multiple blocks as if you had a pipeline and finally in a simple block return all data. This will help a lot.