code: func (impl *SortImpl) CalcCost(outCount float64, childCosts []float64, children ...*memo.Group) float64 {
  	cnt := math.Min(children[0].Prop.Stats.RowCount, impl.plan.GetChildReqProps(0).ExpectedCnt)
  	sort := impl.plan.(*plannercore.PhysicalSort)
  	impl.cost = sort.GetCost(cnt) + childCosts[0]
  	return impl.cost
  }
docs: // CalcCost calculates the cost of the sort Implementation.