mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00: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
152ac564ab
commit
5ca58cc4fb
1 changed files with 4 additions and 0 deletions
|
@ -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 a new issue