code: func getStatsTable(ctx sessionctx.Context, tblInfo *model.TableInfo, pid int64) *statistics.Table {
  	statsHandle := domain.GetDomain(ctx).StatsHandle()
  
  	// 1. tidb-server started and statistics handle has not been initialized.
  	if statsHandle == nil {
  		return statistics.PseudoTable(tblInfo)
  	}
  
  	var statsTbl *statistics.Table
  	if pid != tblInfo.ID {
  		statsTbl = statsHandle.GetPartitionStats(tblInfo, pid)
  	} else {
  		statsTbl = statsHandle.GetTableStats(tblInfo)
  	}
  
  	// 2. table row count from statistics is zero.
  	if statsTbl.Count == 0 {
  		return statistics.PseudoTable(tblInfo)
  	}
  
  	// 3. statistics is outdated.
  	if statsTbl.IsOutdated() {
  		tbl := *statsTbl
  		tbl.Pseudo = true
  		statsTbl = &tbl
  		metrics.PseudoEstimation.Inc()
  	}
  	return statsTbl
  }
docs: // getStatsTable gets statistics information for a table specified by "tableID".
  // A pseudo statistics table is returned in any of the following scenario:
  // 1. tidb-server started and statistics handle has not been initialized.
  // 2. table row count from statistics is zero.
  // 3. statistics is outdated.