V21.03: After pagination+cascade change, queries are too slow to finish

@minhaj Your suggested query still has @cascade in it, and the moment I add any @cascade, the query does not finish, which is my original issue.

But let me assume that was a mistake and that you meant to omit @cascade. The has() filter will not remove nodes based on no edges passing their own filters. Boiled down to an example query:

{
  use_has(func: eq(<qa.type>,"Device"),first:2) @filter(has(<qa.has_object>)) {
    <qa.name>
    <qa.has_object> @filter(eq(<qa.name>,"impossible")) # results in 0 qa.has_object
  }
  use_cascade(func: eq(<qa.type>,"Device"),first:2) @cascade(<qa.has_object>) {
    <qa.name>
    <qa.has_object> @filter(eq(<qa.name>,"impossible")) # results in 0 qa.has_object
  }
}

results in:

{
    "use_has": [
      {
        "qa.name": "IBM-now-4"
      },
      {
        "qa.name": "IBM-now-8"
      }
    ],
    "use_cascade": []
}

So I cannot use has() to filter a level based on the inclusion of any edges post filter. With @cascade forcing the query to now perform 100k as much work as in v20.11, I also cannot use that. Do you have any other suggestions?

1 Like