private void doExtract(){
  alwaysFalse=false;
  start=end=null;
  Database db=session.getDatabase();
  for (int i=0, size=indexConditions.size(); i < size; i++) {
    IndexCondition condition=indexConditions.get(i);
    if (!condition.isEvaluatable()) {
      continue;
    }
    if (condition.isAlwaysFalse()) {
      alwaysFalse=true;
      break;
    }
    Column column=condition.getColumn();
    if (condition.getCompareType() == Comparison.IN_LIST) {
      Value[] inList=condition.getCurrentValueList(session);
      Set<Value> values=inColumns.get(column);
      if (values == null) {
        values=New.hashSet();
        inColumns.put(column,values);
      }
      for (      Value v : inList) {
        if (v != ValueNull.INSTANCE) {
          values.add(v);
        }
      }
    }
 else     if (condition.getCompareType() == Comparison.IN_QUERY) {
      ResultInterface inResult=condition.getCurrentResult();
      Set<Value> values=inColumns.get(column);
      if (values == null) {
        values=New.hashSet();
        inColumns.put(column,values);
      }
      while (inResult.next()) {
        Value v=inResult.currentRow()[0];
        if (v != ValueNull.INSTANCE) {
          v=column.convert(v);
          values.add(v);
        }
      }
    }
 else {
      Value v=condition.getCurrentValue(session);
      boolean isStart=condition.isStart();
      boolean isEnd=condition.isEnd();
      int columnId=column.getColumnId();
      if (isStart) {
        start=getSearchRow(start,columnId,v,true);
      }
      if (isEnd) {
        end=getSearchRow(end,columnId,v,false);
      }
      if (!db.getSettings().optimizeIsNull) {
        if (isStart && isEnd) {
          if (v == ValueNull.INSTANCE) {
            alwaysFalse=true;
          }
        }
      }
    }
    if (alwaysFalse) {
      return;
    }
  }
  for (int i=0, size=indexConditions.size(); i < size; i++) {
    IndexCondition condition=indexConditions.get(i);
    Column column=condition.getColumn();
    int idx=column.getColumnId();
    Value v1=start == null ? null : start.getValue(idx);
    Value v2=end == null ? null : end.getValue(idx);
    if (v1 == null && v2 == null) {
      continue;
    }
 else     if (v1 != null || v2 != null) {
      if (v1 != null) {
        Set<Value> values=inColumns.get(column);
        if (values != null) {
          for (          Value value : values) {
            if (db.compare(value,v1) < 0) {
              values.remove(value);
            }
          }
          if (values.isEmpty()) {
            alwaysFalse=true;
          }
        }
      }
 else {
        Set<Value> values=inColumns.get(column);
        if (values != null) {
          for (          Value value : values) {
            if (db.compare(value,v1) > 0) {
              values.remove(value);
            }
          }
          if (values.isEmpty()) {
            alwaysFalse=true;
          }
        }
      }
    }
 else {
      if (db.compare(v1,v2) > 0) {
        alwaysFalse=true;
      }
    }
  }
  if (alwaysFalse) {
    return;
  }
}

private void doExtract ( ) { alwaysFalse = false ; start = end = null ; Database db = session . getDatabase ( ) ; for ( int i = 0 , size = indexConditions . size ( ) ; i < size ; i ++ ) { IndexCondition condition = indexConditions . get ( i ) ; if ( ! condition . isEvaluatable ( ) ) { continue ; } if ( condition . isAlwaysFalse ( ) ) { alwaysFalse = true ; break ; } Column column = condition . getColumn ( ) ; if ( condition . getCompareType ( ) == Comparison . IN_LIST ) { Value [ ] inList = condition . getCurrentValueList ( session ) ; Set < Value > values = inColumns . get ( column ) ; if ( values == null ) { values = New . hashSet ( ) ; inColumns . put ( column , values ) ; } for ( Value v : inList ) { if ( v != ValueNull . INSTANCE ) { values . add ( v ) ; } } } else if ( condition . getCompareType ( ) == Comparison . IN_QUERY ) { ResultInterface inResult = condition . getCurrentResult ( ) ; Set < Value > values = inColumns . get ( column ) ; if ( values == null ) { values = New . hashSet ( ) ; inColumns . put ( column , values ) ; } while ( inResult . next ( ) ) { Value v = inResult . currentRow ( ) [ 0 ] ; if ( v != ValueNull . INSTANCE ) { v = column . convert ( v ) ; values . add ( v ) ; } } } else { Value v = condition . getCurrentValue ( session ) ; boolean isStart = condition . isStart ( ) ; boolean isEnd = condition . isEnd ( ) ; int columnId = column . getColumnId ( ) ; if ( isStart ) { start = getSearchRow ( start , columnId , v , true ) ; } if ( isEnd ) { end = getSearchRow ( end , columnId , v , false ) ; } if ( ! db . getSettings ( ) . optimizeIsNull ) { if ( isStart && isEnd ) { if ( v == ValueNull . INSTANCE ) { alwaysFalse = true ; } } } } if ( alwaysFalse ) { return ; } } for ( int i = 0 , size = indexConditions . size ( ) ; i < size ; i ++ ) { IndexCondition condition = indexConditions . get ( i ) ; Column column = condition . getColumn ( ) ; int idx = column . getColumnId ( ) ; Value v1 = start == null ? null : start . getValue ( idx ) ; Value v2 = end == null ? null : end . getValue ( idx ) ; if ( v1 == null && v2 == null ) { continue ; } else if ( v1 != null || v2 != null ) { if ( v1 != null ) { Set < Value > values = inColumns . get ( column ) ; if ( values != null ) { for ( Value value : values ) { if ( db . compare ( value , v1 ) < 0 ) { values . remove ( value ) ; } } if ( values . isEmpty ( ) ) { alwaysFalse = true ; } } } else { Set < Value > values = inColumns . get ( column ) ; if ( values != null ) { for ( Value value : values ) { if ( db . compare ( value , v1 ) > 0 ) { values . remove ( value ) ; } } if ( values . isEmpty ( ) ) { alwaysFalse = true ; } } } } else { if ( db . compare ( v1 , v2 ) > 0 ) { alwaysFalse = true ; } } } if ( alwaysFalse ) { return ; } }
prepare this index cursor to make a lookup in index .
