I can not say with exact precision which approach is more performative. But I believe that using both can be quite useful. As I said IMO, having separate predicates indexed separately is interesting. Especially if you will practice queries of different approaches on each type of Node.
I’d say that labeling Node types and merging with @filter is a powerful approach.
E.g:
email: string @index(exact) .
{
userWithEmail(func: has(_user)) @filter( eq(email, "test@user.com") {
name
email
}
}
E.g 2:
name: string @index(hash, term, trigram) .
{
myusers(func: has(_user)) @filter(regexp(name@en, /Donald/i)) {
name
email
}
}
By Logic, if you have a single indexed predicate, it will become gigantic over time. So it would be interesting to have different predicates thus having different indexing tables. In my opinion. But this is a personal view, the Dgraph can perfectly handle gigantic indexing table.
Never