code: func (p *Aggregation) PruneColumns(parentUsedCols []*expression.Column) {
  	child := p.GetChildByIndex(0).(LogicalPlan)
  	used := getUsedList(parentUsedCols, p.schema)
  	for i := len(used) - 1; i >= 0; i-- {
  		if !used[i] {
  			p.schema.Columns = append(p.schema.Columns[:i], p.schema.Columns[i+1:]...)
  			p.AggFuncs = append(p.AggFuncs[:i], p.AggFuncs[i+1:]...)
  		}
  	}
  	var selfUsedCols []*expression.Column
  	for _, aggrFunc := range p.AggFuncs {
  		for _, arg := range aggrFunc.GetArgs() {
  			selfUsedCols = append(selfUsedCols, expression.ExtractColumns(arg)...)
  		}
  	}
  	for _, expr := range p.GroupByItems {
  		selfUsedCols = append(selfUsedCols, expression.ExtractColumns(expr)...)
  	}
  	child.PruneColumns(selfUsedCols)
  }
docs: // PruneColumns implements LogicalPlan interface.