prometheus/tsdb
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
..
agent tsdb tests: make work with labels SymbolTable 2024-02-26 11:45:25 +00:00
chunkenc Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
chunks Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
docs Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
encoding
errors
fileutil tests: remove err from message when testify prints it already 2024-02-01 14:18:01 +00:00
goversion remove obsolete build tag 2024-01-17 22:26:32 +08:00
index [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
record Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
testdata
tombstones
tsdbutil
wlog Merge pull request #13919 from GiedriusS/dont_forget_to_unregister 2024-04-18 16:44:03 -03:00
.gitignore
block.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
block_test.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
blockwriter.go Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
blockwriter_test.go
CHANGELOG.md
compact.go Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
compact_test.go Optimize histogram iterators (#13340) 2024-01-23 17:02:14 +01:00
db.go Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
db_test.go Write out of order hint when initially creating meta file (#13894) 2024-04-08 17:34:14 +02:00
example_test.go
exemplar.go Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
exemplar_test.go Standardise exemplar label as "trace_id" 2024-02-15 14:20:08 +00:00
head.go TSDB: Don't rely on integer overflow in head compaction check (#13755) 2024-03-26 12:17:38 +01:00
head_append.go Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
head_bench_test.go
head_read.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
head_read_test.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
head_test.go golangci-lint: enable whitespace linter (#13905) 2024-04-11 09:27:54 +01:00
head_wal.go Fix language in docs and comments (#14041) 2024-05-08 17:57:09 +02:00
isolation.go
isolation_test.go
mocks_test.go
ooo_head.go
ooo_head_read.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
ooo_head_read_test.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
ooo_head_test.go
ooo_isolation.go
ooo_isolation_test.go
querier.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
querier_bench_test.go Optimize label values with matchers by taking shortcuts (#13426) 2024-01-23 11:40:21 +01:00
querier_test.go [ENHANCEMENT] TSDB: Optimize querying with regexp matchers 2024-05-09 10:55:30 +01:00
README.md
repair.go
repair_test.go tsdb tests: use go-cmp instead of DeepEquals 2024-02-08 19:32:33 +00:00
tsdbblockutil.go Optimize histogram iterators (#13340) 2024-01-23 17:02:14 +01:00

TSDB

GoPkg

This directory contains the Prometheus TSDB (Time Series DataBase) library, which handles storage and querying of all Prometheus v2 data.

Documentation

External resources

A series of blog posts explaining different components of TSDB: