Recurse at only specified predicates

Michel Conrado just pointed out to me that the following query would be more performant.

{
   tree(func: eq(name, "bob")) {
   p as uid
    parent {
      name
    }
    name
  }
}

{
  children(func: uid(p) ) @recurse  {
    child
  }
}

since the index only needs to be traversed once.

3 Likes