code: func (r *rangeBuilder) buildIndexRanges(rangePoints []rangePoint, tp *types.FieldType) []*IndexRange {
  	indexRanges := make([]*IndexRange, 0, len(rangePoints)/2)
  	for i := 0; i < len(rangePoints); i += 2 {
  		startPoint := r.convertPoint(rangePoints[i], tp)
  		endPoint := r.convertPoint(rangePoints[i+1], tp)
  		less, err := rangePointLess(r.sc, startPoint, endPoint)
  		if err != nil {
  			r.err = errors.Trace(err)
  		}
  		if !less {
  			continue
  		}
  		ir := &IndexRange{
  			LowVal:      []types.Datum{startPoint.value},
  			LowExclude:  startPoint.excl,
  			HighVal:     []types.Datum{endPoint.value},
  			HighExclude: endPoint.excl,
  		}
  		indexRanges = append(indexRanges, ir)
  	}
  	return indexRanges
  }
docs: // buildIndexRanges build index ranges from range points.
  // Only the first column in the index is built, extra column ranges will be appended by
  // appendIndexRanges.