mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2025-01-20 15:29:24 +01:00
lib/storage: optimization: do not scan block for rows outside retention if it is covered by the retention
This commit is contained in:
parent
fd9d0a550b
commit
233301a549
@ -178,6 +178,10 @@ func mergeBlocks(ob, ib1, ib2 *Block, retentionDeadline int64, rowsDeleted *uint
|
||||
}
|
||||
|
||||
func skipSamplesOutsideRetention(b *Block, retentionDeadline int64, rowsDeleted *uint64) {
|
||||
if b.bh.MinTimestamp >= retentionDeadline {
|
||||
// Fast path - the block contains only samples with timestamps bigger than retentionDeadline.
|
||||
return
|
||||
}
|
||||
timestamps := b.timestamps
|
||||
nextIdx := b.nextIdx
|
||||
nextIdxOrig := nextIdx
|
||||
|
Loading…
Reference in New Issue
Block a user