Search in sources :

Example 1 with OIdentifiableIterator

use of com.orientechnologies.orient.core.iterator.OIdentifiableIterator in project orientdb by orientechnologies.

the class OCommandExecutorSQLSelect method serialIterator.

private boolean serialIterator(Iterator<? extends OIdentifiable> iTarget) {
    int queryScanThresholdWarning = OGlobalConfiguration.QUERY_SCAN_THRESHOLD_TIP.getValueAsInteger();
    boolean tipActivated = queryScanThresholdWarning > 0 && iTarget instanceof OIdentifiableIterator && compiledFilter != null;
    // BROWSE, UNMARSHALL AND FILTER ALL THE RECORDS ON CURRENT THREAD
    for (int browsed = 0; iTarget.hasNext(); browsed++) {
        final OIdentifiable next = iTarget.next();
        if (!executeSearchRecord(next, context, false))
            return false;
        if (tipActivated && browsed > queryScanThresholdWarning) {
            reportTip(String.format("Query '%s' fetched more than %d records: to speed up the execution, create an index or change the query to use an existent index", parserText, queryScanThresholdWarning));
            tipActivated = false;
        }
    }
    return true;
}
Also used : OIdentifiableIterator(com.orientechnologies.orient.core.iterator.OIdentifiableIterator) OIdentifiable(com.orientechnologies.orient.core.db.record.OIdentifiable)

Aggregations

OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)1 OIdentifiableIterator (com.orientechnologies.orient.core.iterator.OIdentifiableIterator)1