prometheus/tsdb/index
Arve Knudsen 5c4310aa37
[ENHANCEMENT] TSDB: Optimize querying with regexp matchers
Add method `PostingsForLabelMatching` to `tsdb.IndexReader`, to obtain postings for labels with a certain name and values accepted by a provided callback, and use it from `tsdb.PostingsForMatchers`.
The intention is to optimize regexp matcher paths, especially not having to load all label values before matching on them.

Plus tests, and refactor some `tsdb/index.Reader` methods.

Benchmarking shows memory reduction up to ~100%, and speedup of up to ~50%.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Bartlomiej Plotka <bwplotka@gmail.com>
2024-05-09 10:55:30 +01:00
..
index.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
index_test.go Tests: use replacement DeepEquals in more places 2024-02-08 19:32:33 +00:00
postings.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
postings_test.go Refactor tsdb tests to use testify. 2024-01-31 16:03:17 +00:00
postingsstats.go Move from golang.org/x/exp/slices into slices now that we only support Go >= 1.21 2024-02-28 14:54:53 +01:00
postingsstats_test.go golangci-lint: enable testifylint linter (#13254) 2023-12-07 11:35:01 +00:00