public long getOrderTimeForUnseq(IDeviceID deviceId, boolean ascending) {
    if (timeIndex instanceof ArrayDeviceTimeIndex) {
      if (ascending) {
        return timeIndex.getStartTime(deviceId).orElse(Long.MIN_VALUE);
      } else {
        return timeIndex.getEndTime(deviceId).orElse(Long.MAX_VALUE);
      }
    } else {
      // FileTimeIndex
      return ascending ? getFileStartTime() : getFileEndTime();
    }
  }
open file's end time is Long.MIN_VALUE
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/TsFileResource.java