Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,17 +467,18 @@ func (s *state) HasCount(ctx context.Context, pred string) bool {
func (s *state) PredicatesToDelete(pred string) []string {
s.RLock()
defer s.RUnlock()
preds := make([]string, 0)
if schema, ok := s.predicate[pred]; ok {
preds = append(preds, pred)

if schema.ValueType == pb.Posting_VFLOAT && len(schema.IndexSpecs) != 0 {
preds = append(preds, pred+hnsw.VecEntry)
preds = append(preds, pred+hnsw.VecKeyword)
preds = append(preds, pred+hnsw.VecDead)
}
schema, ok := s.predicate[pred]
if !ok {
return nil
}
if schema.ValueType == pb.Posting_VFLOAT && len(schema.IndexSpecs) != 0 {
// Vector predicate: pre-size to 4 (base + 3 vector sidecar preds).
preds := make([]string, 1, 4)
preds[0] = pred
return append(preds, pred+hnsw.VecEntry, pred+hnsw.VecKeyword, pred+hnsw.VecDead)
}
return preds
// Common case: exactly one predicate.
return []string{pred}
}

// IsList returns whether the predicate is of list type.
Expand Down
Loading