prometheus/tsdb/index
Alan Protasio 25aee26a57
Improving "Sparse postings" intersection (#13971)
Lets take the given example:

P1: [2, 5, 9, 18, 21]
P2: [3, 7, 14, 19, 21]
P3: [1, 21]

Currently, we would only advance through P1 and P2 until discovering
an intersection and then checking P3. In essence, the traversal order
was: 2, 3, 5, 7, 9, 14, 18, 19, 21 (intersection found).

With the proposed change, P3 is also examined even if P1 and P2
haven't found an intersection yet. This adjustment allows for the
possibility of skipping some iterations.

Post-change, the traversal order becomes: 2, 3, 21 (3 iterations instead of 9).

Signed-off-by: alanprot <alanprot@gmail.com>
2025-08-05 12:22:54 +01:00
..
index_test.go [PERF] TSDB: Pass down label value limit into implementation (#16158) 2025-05-06 18:54:48 +01:00
index.go [PERF] TSDB: Pass down label value limit into implementation (#16158) 2025-05-06 18:54:48 +01:00
postings_test.go Expose ListPostings Length via Len() method (#15678) 2025-01-07 17:58:26 +01:00
postings.go Improving "Sparse postings" intersection (#13971) 2025-08-05 12:22:54 +01:00
postingsstats_test.go Upgrade golangci-lint to v1.60.1 2024-08-18 12:13:25 +02: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