Hi Kenan,
Perhaps we can further improve on 1.38 seconds option. In the query below,
q($start: int, $end: int, $limit: int = 0) {
var_a as var(func: eq(<qa.type>, "Device"), first: $limit) {
var_b as <qa.has_object> @filter(eq(<qa.type>, "Object")) (first: $limit) {
var_c as <qa.has_indicator> @filter(eq(<qa.type>, "Indicator")) (first: $limit)
}
}
You can start with an Indicator type and go reverse up to Device. You can start with a smaller number of Indicator types ($limit). There are better chances of getting a couple of hits and this may improve the query performance. The query segment would look as below
q($start: int, $end: int, $limit: int = 0) {
var_c as var(func: eq(eq(<qa.type>, "Indicator") {
var_b as <~qa.has_indicator> @filter(eq(<qa.type>, "Object")) (first: $limit) {
var_a as q1<~qa.has_object> @filter()<qa.type>, "Device"), first: $limit) (first: $limit)
}
}
Also, thanks for the feedback you have provided. A component called Query Planner is being worked on which will address some of the suggestions you have provided.