use of com.baidu.hugegraph.backend.page.QueryList in project incubator-hugegraph by apache.
the class GraphTransaction method optimizeQueries.
private <R> QueryList<R> optimizeQueries(Query query, QueryResults.Fetcher<R> fetcher) {
boolean supportIn = this.storeFeatures().supportsQueryWithInCondition();
QueryList<R> queries = new QueryList<>(query, fetcher);
for (ConditionQuery cq : ConditionQueryFlatten.flatten((ConditionQuery) query, supportIn)) {
// Optimize by sysprop
Query q = this.optimizeQuery(cq);
/*
* NOTE: There are two possibilities for this query:
* 1.sysprop-query, which would not be empty.
* 2.index-query result(ids after optimization), which may be empty.
*/
if (q == null) {
queries.add(this.indexQuery(cq), this.batchSize);
} else if (!q.empty()) {
queries.add(q);
}
}
return queries;
}
Aggregations