mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
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:
parent
fdbf5b5795
commit
0d46e24af5
2 changed files with 3 additions and 3 deletions
|
@ -872,7 +872,7 @@ func getOrValuesExt(sre *syntax.Regexp) []string {
|
|||
}
|
||||
}
|
||||
|
||||
const maxOrValues = 20
|
||||
const maxOrValues = 100
|
||||
|
||||
var tagCharsRegexpEscaper = strings.NewReplacer(
|
||||
"\\x00", "\\x000", // escapeChar
|
||||
|
|
|
@ -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"})
|
||||
|
|
Loading…
Reference in a new issue