Search in sources :

Example 1 with QueryList

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;
}
Also used : Query(com.baidu.hugegraph.backend.query.Query) ConditionQuery(com.baidu.hugegraph.backend.query.ConditionQuery) IdQuery(com.baidu.hugegraph.backend.query.IdQuery) ConditionQuery(com.baidu.hugegraph.backend.query.ConditionQuery) QueryList(com.baidu.hugegraph.backend.page.QueryList)

Aggregations

QueryList (com.baidu.hugegraph.backend.page.QueryList)1 ConditionQuery (com.baidu.hugegraph.backend.query.ConditionQuery)1 IdQuery (com.baidu.hugegraph.backend.query.IdQuery)1 Query (com.baidu.hugegraph.backend.query.Query)1