Avoid using has func at root, especially when you have tons of data. You can use on filters tho.
The best approach here to gain perf is using indexation. Any kind.
Also, I personally would recommend that you segment your types. Doing a pattern like “namespacing”.
For example. The predicate “name”. You can have this very same predicate shared with several entities. This isn’t too good. So, I recommend that you do like:
user.name: string .
product.name: string .
animal.name: string .
object.name: string .
...
So on and so forth.
You should do this block like this
A0 as var(func: type(Post)) @filter(le(creationDate,"2011-09-30") AND ge(creationDate, "2011-09-01"))
A1 as var(func: type(Comment)) @filter(le(creationDate,"2011-09-30") AND ge(creationDate, "2011-09-01"))
var(func: uid(A0,A1)){
hasTag {
tag_uid as uid
}
That way you can have a better performance.