Skip to content

PromQL: Dot in regexp should also match newlines (which is less surprising to most users and also allows optimising the .* regexp) #7859

@Betula-L

Description

@Betula-L

What did you do?

I found that wildcard label matcher such as app=~".*" impact on query performance significantly.

Then i tried to edit benchmark BenchmarkPostingsForMatchers as followed,

image

The results is amazing!!!

The time consumption with wildcard is worser 100K times than without wildcard.

BenchmarkPostingsForMatchers/Head/n="1",i=~".*",j="foo"-16                     5         213092008 ns/op
BenchmarkPostingsForMatchers/Head/n="1",j="foo"-16                        593829              1838 ns/op

What did you expect to see?

Label matcher {n="1",i=~".*",j="foo} is equal to label matcher {n="1"j="foo}, so the evaluation cost should be similar.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions