code: func (p *PhysicalIndexScan) ToPB(ctx sessionctx.Context) (*tipb.Executor, error) {
  	columns := make([]*model.ColumnInfo, 0, p.schema.Len())
  	tableColumns := p.Table.Cols()
  	for _, col := range p.schema.Columns {
  		if col.ID == model.ExtraHandleID {
  			columns = append(columns, model.NewExtraHandleColInfo())
  		} else {
  			columns = append(columns, model.FindColumnInfo(tableColumns, col.ColName.L))
  		}
  	}
  	idxExec := &tipb.IndexScan{
  		TableId: p.Table.ID,
  		IndexId: p.Index.ID,
  		Columns: model.ColumnsToProto(columns, p.Table.PKIsHandle),
  		Desc:    p.Desc,
  	}
  	unique := checkCoverIndex(p.Index, p.Ranges)
  	idxExec.Unique = &unique
  	return &tipb.Executor{Tp: tipb.ExecType_TypeIndexScan, IdxScan: idxExec}, nil
  }
docs: // ToPB implements PhysicalPlan ToPB interface.