code: func (m *UnpartitionedMemoryIdx) deleteTaggedByIdSet(orgId uint32, ids IdSet) []idx.Archive {
  	tags, ok := m.tags[orgId]
  	if !ok {
  		return nil
  	}
  
  	deletedDefs := make([]idx.Archive, 0, len(ids))
  	for id := range ids {
  		idStr := id
  		def, ok := m.defById[idStr]
  		if !ok {
  			// not necessarily a corruption, the id could have been deleted
  			// while we switched from read to write lock
  			continue
  		}
  		if !m.deindexTags(tags, &def.MetricDefinition) {
  			continue
  		}
  		deletedDefs = append(deletedDefs, *def)
  		delete(m.defById, idStr)
  	}
  
  	statMetricsActive.Set(len(m.defById))
  
  	return deletedDefs
  }
docs: // deleteTaggedByIdSet deletes a map of ids from the tag index and also the DefByIds
  // it is important that only IDs of series with tags get passed in here, because
  // otherwise the result might be inconsistencies between DefByIDs and the tree index.