Skip to content

Commit

Permalink
Merge #104560
Browse files Browse the repository at this point in the history
104560: storage: increase capacity of PointKeyFilters slice r=jbowens a=sumeerbhola

This is to conform to the recently introduced performance recommendation in pebble.IterOptions.

Informs cockroachdb/pebble#2465

Epic: none

Release note: None

Co-authored-by: sumeerbhola <[email protected]>
  • Loading branch information
craig[bot] and sumeerbhola committed Jun 13, 2023
2 parents 6abe185 + ba053dd commit 1b04e79
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/storage/pebble_iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,11 +277,16 @@ func (p *pebbleIterator) setOptions(opts IterOptions, durability DurabilityRequi
// We are given an inclusive [MinTimestampHint, MaxTimestampHint]. The
// MVCCWAllTimeIntervalCollector has collected the WallTimes and we need
// [min, max), i.e., exclusive on the upper bound.
p.options.PointKeyFilters = []pebble.BlockPropertyFilter{
//
// NB: PointKeyFilters documents that when set to non-empty, the capacity
// of the slice should be at least one more than the length, for a
// Pebble-internal performance optimization.
pkf := [2]pebble.BlockPropertyFilter{
sstable.NewBlockIntervalFilter(mvccWallTimeIntervalCollector,
uint64(opts.MinTimestampHint.WallTime),
uint64(opts.MaxTimestampHint.WallTime)+1),
}
p.options.PointKeyFilters = pkf[:1:2]
// NB: We disable range key block filtering because of complications in
// MVCCIncrementalIterator.maybeSkipKeys: the TBI may see different range
// key fragmentation than the main iterator due to the filtering. This would
Expand Down

0 comments on commit 1b04e79

Please sign in to comment.