diff --git a/lib/storage/tag_filters.go b/lib/storage/tag_filters.go index 6785d96caf..4fc38605b9 100644 --- a/lib/storage/tag_filters.go +++ b/lib/storage/tag_filters.go @@ -264,6 +264,9 @@ func (tf *tagFilter) InitFromGraphiteQuery(commonPrefix, query []byte, paths []s if len(orSuffixes) == 0 { orSuffixes = append(orSuffixes, "") } + // Sort orSuffixes for faster seek later. + sort.Strings(orSuffixes) + tf.key = append(tf.key[:0], "__graphite__"...) tf.value = append(tf.value[:0], query...) tf.isNegative = isNegative