code: func getTableRange(d *ddlCtx, tbl table.PhysicalTable, snapshotVer uint64, priority int) (startHandle, endHandle int64, err error) {
  	startHandle = math.MinInt64
  	endHandle = math.MaxInt64
  	// Get the start handle of this partition.
  	err = iterateSnapshotRows(d.store, priority, tbl, snapshotVer, math.MinInt64, math.MaxInt64, true,
  		func(h int64, rowKey kv.Key, rawRecord []byte) (bool, error) {
  			startHandle = h
  			return false, nil
  		})
  	if err != nil {
  		return 0, 0, errors.Trace(err)
  	}
  	var emptyTable bool
  	// Get the end handle of this partition.
  	endHandle, emptyTable, err = d.GetTableMaxRowID(snapshotVer, tbl)
  	if err != nil {
  		return 0, 0, errors.Trace(err)
  	}
  	if endHandle < startHandle || emptyTable {
  		logutil.Logger(ddlLogCtx).Info("[ddl] get table range, endHandle < startHandle", zap.String("table", fmt.Sprintf("%v", tbl.Meta())),
  			zap.Int64("partitionID", tbl.GetPhysicalID()), zap.Int64("endHandle", endHandle), zap.Int64("startHandle", startHandle))
  		endHandle = startHandle
  	}
  	return
  }
docs: // getTableRange gets the start and end handle of a table (or partition).