diff --git a/lib/storage/dedup.go b/lib/storage/dedup.go index aa78665dbd..1d0765f072 100644 --- a/lib/storage/dedup.go +++ b/lib/storage/dedup.go @@ -57,6 +57,11 @@ func deduplicateSamplesDuringMerge(srcTimestamps []int64, srcValues []int64) ([] if *minScrapeInterval <= 0 { return srcTimestamps, srcValues } + if len(srcTimestamps) < 32 { + // Do not de-duplicate small number of samples during merge + // in order to improve deduplication accuracy on later stages. + return srcTimestamps, srcValues + } minDelta := getMinDelta() if !needsDedup(srcTimestamps, minDelta) { // Fast path - nothing to deduplicate