It seems that there’s performance degradation as more conditions/filters are added. For example:
{
search(func: has(something)) @filter(eq(A, "valA")) {
expand(_all_)
}
}
The above returns one node after approximately 2.4ms. However, when an additional filter is applied:
{
search(func: has(something)) @filter(eq(A, "valA") AND eq(B, "valB")) {
expand(_all_)
}
The above now returns the same single node after approximately 5.7s, that’s more than 2,000x slower. Using that same example above without eq(A, "valA")
and only filtering using eq(B, "valB")
returns also after approximately 5.7s, this leads me to believe that the query will only be as fast as the slowest of the filters applied.
How are conditions evaluated?
What can I do to improve these types of queries?
Is this a problem with DGraph that needs addressing?
In my local testing, I’m actually filtering on five different predicate values (A, B, C, D, E) and it’s taking approximately 38s to return. The data points of my local data:
26,000 nodes
Predicates are indexed as hash