HasCount returns whether we want to mantain a count index for the given predicate or not.
(ctx context.Context, pred string)
| 450 | |
| 451 | // HasCount returns whether we want to mantain a count index for the given predicate or not. |
| 452 | func (s *state) HasCount(ctx context.Context, pred string) bool { |
| 453 | isWrite, _ := ctx.Value(IsWrite).(bool) |
| 454 | s.RLock() |
| 455 | defer s.RUnlock() |
| 456 | if isWrite { |
| 457 | if schema, ok := s.mutSchema[pred]; ok && schema.Count { |
| 458 | return true |
| 459 | } |
| 460 | } |
| 461 | if schema, ok := s.predicate[pred]; ok { |
| 462 | return schema.Count |
| 463 | } |
| 464 | return false |
| 465 | } |
| 466 | |
| 467 | func (s *state) PredicatesToDelete(pred string) []string { |
| 468 | s.RLock() |
no test coverage detected