@Override
  public long calculateRetainedSizeAfterCallingNext() {
    long childrenSum = 0;
    long minChildReturnSize = Long.MAX_VALUE;
    for (Operator child : children) {
      long maxReturnSize = child.calculateMaxReturnSize();
      childrenSum += (maxReturnSize + child.calculateRetainedSizeAfterCallingNext());
      minChildReturnSize = Math.min(minChildReturnSize, maxReturnSize);
    }
    // max cached TsBlock + cached TreeMap size
    return (childrenSum - minChildReturnSize)
        + TSFileDescriptor.getInstance().getConfig().getMaxTsBlockLineNumber()
            * MAP_NODE_RETRAINED_SIZE;
  }
prepare next batch

@return true if need to break current loop, otherwise false
@throws Exception errors happened while fetching next batch data
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/operator/process/last/LastQueryMergeOperator.java