@Override
  public void start() {
    final long startTime = System.nanoTime();
    if (skipExecute()) {
      LOGGER.debug("[SkipExecute]");
      if (analysis.isFailed()) {
        stateMachine.transitionToFailed(analysis.getFailStatus());
      } else {
        constructResultForMemorySource();
        stateMachine.transitionToRunning();
      }
      return;
    }

    // check timeout for query first
    checkTimeOutForQuery();
    doLogicalPlan();

    if (skipExecute()) {
      // TODO move this judgement to analyze state?
      LOGGER.debug("[SkipExecute After LogicalPlan]");
      if (analysis.isFailed()) {
        stateMachine.transitionToFailed(analysis.getFailStatus());
      } else {
        constructResultForMemorySource();
        stateMachine.transitionToRunning();
      }
      return;
    }

    doDistributedPlan();

    stateMachine.transitionToPlanned();
    if (context.getQueryType() == QueryType.READ) {
      initResultHandle();
    }
    PERFORMANCE_OVERVIEW_METRICS.recordPlanCost(System.nanoTime() - startTime);
    schedule();

    // The last batch of memory reserved by the front end
    context.reserveMemoryForFrontEndImmediately();

    // friendly for gc
    logicalPlan.clearUselessMemory();

    // set partial insert error message
    // When some columns in one insert failed, other column will continue executing insertion.
    // The error message should be return to client, therefore we need to set it after the insertion
    // of other column finished.
    if (context.getQueryType() == QueryType.WRITE && analysis.isFailed()) {
      stateMachine.transitionToFailed(analysis.getFailStatus());
    }
  }
QueryExecution stores all the status of a query which is being prepared or running inside the MPP
frame. It takes three main responsibilities: 1. Prepare a query. Transform a query from statement
to DistributedQueryPlan with fragment instances. 2. Dispatch all the fragment instances to
corresponding physical nodes. 3. Collect and monitor the progress/states of this query.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/execution/QueryExecution.java