code: func DecodeKeyHead(key kv.Key) (tableID int64, indexID int64, isRecordKey bool, err error) {
  	isRecordKey = false
  	k := key
  	if !key.HasPrefix(tablePrefix) {
  		err = errInvalidKey.GenWithStack("invalid key - %q", k)
  		return
  	}
  
  	key = key[len(tablePrefix):]
  	key, tableID, err = codec.DecodeInt(key)
  	if err != nil {
  		err = errors.Trace(err)
  		return
  	}
  
  	if key.HasPrefix(recordPrefixSep) {
  		isRecordKey = true
  		return
  	}
  	if !key.HasPrefix(indexPrefixSep) {
  		err = errInvalidKey.GenWithStack("invalid key - %q", k)
  		return
  	}
  
  	key = key[len(indexPrefixSep):]
  
  	key, indexID, err = codec.DecodeInt(key)
  	if err != nil {
  		err = errors.Trace(err)
  		return
  	}
  	return
  }
docs: // DecodeKeyHead decodes the key's head and gets the tableID, indexID. isRecordKey is true when is a record key.