code: func (c *indexIter) Next() (val []types.Datum, h int64, err error) {
  	if !c.it.Valid() {
  		return nil, 0, errors.Trace(io.EOF)
  	}
  	if !c.it.Key().HasPrefix(c.prefix) {
  		return nil, 0, errors.Trace(io.EOF)
  	}
  	// get indexedValues
  	buf := c.it.Key()[len(c.prefix):]
  	vv, err := codec.Decode(buf, len(c.idx.idxInfo.Columns))
  	if err != nil {
  		return nil, 0, err
  	}
  	if len(vv) > len(c.idx.idxInfo.Columns) {
  		h = vv[len(vv)-1].GetInt64()
  		val = vv[0 : len(vv)-1]
  	} else {
  		// If the index is unique and the value isn't nil, the handle is in value.
  		h, err = DecodeHandle(c.it.Value())
  		if err != nil {
  			return nil, 0, err
  		}
  		val = vv
  	}
  	// update new iter to next
  	err = c.it.Next()
  	if err != nil {
  		return nil, 0, err
  	}
  	return
  }
docs: // Next returns current key and moves iterator to the next step.