lib/storage: increase the maximum possible or values extracted from regexp from 20 to 100

This should improve time series search speed for regexp filters with big number of `or` values.
This commit is contained in:
Aliaksandr Valialkin 2022-08-24 17:15:21 +03:00
parent fdbf5b5795
commit 0d46e24af5
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
2 changed files with 3 additions and 3 deletions

View file

@ -872,7 +872,7 @@ func getOrValuesExt(sre *syntax.Regexp) []string {
}
}
const maxOrValues = 20
const maxOrValues = 100
var tagCharsRegexpEscaper = strings.NewReplacer(
"\\x00", "\\x000", // escapeChar

View file

@ -1166,14 +1166,14 @@ func TestGetOrValues(t *testing.T) {
f("foo|bar", []string{"bar", "foo"})
f("(foo|bar)", []string{"bar", "foo"})
f("(foo|bar)baz", []string{"barbaz", "foobaz"})
f("[a-z]", nil)
f("[a-z][a-z]", nil)
f("[a-d]", []string{"a", "b", "c", "d"})
f("x[a-d]we", []string{"xawe", "xbwe", "xcwe", "xdwe"})
f("foo(bar|baz)", []string{"foobar", "foobaz"})
f("foo(ba[rz]|(xx|o))", []string{"foobar", "foobaz", "fooo", "fooxx"})
f("foo(?:bar|baz)x(qwe|rt)", []string{"foobarxqwe", "foobarxrt", "foobazxqwe", "foobazxrt"})
f("foo(bar||baz)", []string{"foo", "foobar", "foobaz"})
f("(a|b|c)(d|e|f)(g|h|k)", nil)
f("(a|b|c)(d|e|f|0|1|2)(g|h|k|x|y|z)", nil)
f("(?i)foo", nil)
f("(?i)(foo|bar)", nil)
f("^foo|bar$", []string{"bar", "foo"})