diff --git a/lib/storage/tag_filters.go b/lib/storage/tag_filters.go index 6d35beaf7f..878f7621ab 100644 --- a/lib/storage/tag_filters.go +++ b/lib/storage/tag_filters.go @@ -246,6 +246,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