forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
84961: storage: require valid iterator for `HasPointAndRange()` r=jbowens a=erikgrinaker This patch requires the caller to check `Valid()` before calling `SimpleMVCCIterator.HasPointAndRange()`. This avoids making redundant `Valid()` calls internally in `HasPointAndRange()`, which has a non-negligible cost, especially considering callers may often make multiple calls to `HasPointAndRange()` but only a single call to `Valid()` per step. This improves scan performance by as much as 2.5% in the no-range-key case. This also allows combining `EngineIterator.HasEnginePointAndRange()` with `HasPointAndRange()`, since `pebbleIterator.Valid()` could not be called from `EngineIterator` methods (due to lock table checks). ``` MVCCScan_Pebble/rows=1/versions=1/valueSize=64-24 4.75µs ± 2% 4.78µs ± 2% ~ (p=0.210 n=10+10) MVCCScan_Pebble/rows=1/versions=10/valueSize=64-24 6.63µs ± 1% 6.62µs ± 1% ~ (p=0.590 n=9+10) MVCCScan_Pebble/rows=100/versions=1/valueSize=64-24 38.9µs ± 1% 38.4µs ± 1% -1.45% (p=0.001 n=10+10) MVCCScan_Pebble/rows=100/versions=10/valueSize=64-24 124µs ± 1% 121µs ± 1% -2.52% (p=0.000 n=10+10) MVCCScan_Pebble/rows=10000/versions=1/valueSize=64-24 2.91ms ± 1% 2.84ms ± 1% -2.39% (p=0.000 n=10+10) MVCCScan_Pebble/rows=10000/versions=10/valueSize=64-24 10.8ms ± 1% 10.5ms ± 1% -2.17% (p=0.000 n=10+9) MVCCGet_Pebble/batch=false/versions=1/valueSize=8-24 4.38µs ± 1% 4.37µs ± 1% ~ (p=0.920 n=10+9) MVCCGet_Pebble/batch=false/versions=10/valueSize=8-24 5.41µs ± 1% 5.39µs ± 2% ~ (p=0.170 n=10+10) MVCCGet_Pebble/batch=false/versions=100/valueSize=8-24 13.4µs ± 2% 13.2µs ± 1% -1.01% (p=0.016 n=10+9) MVCCGet_Pebble/batch=true/versions=1/valueSize=8-24 2.78µs ± 1% 2.77µs ± 1% -0.50% (p=0.021 n=10+9) MVCCGet_Pebble/batch=true/versions=10/valueSize=8-24 3.98µs ± 1% 3.98µs ± 1% ~ (p=0.921 n=9+10) MVCCGet_Pebble/batch=true/versions=100/valueSize=8-24 10.7µs ± 3% 10.6µs ± 5% ~ (p=0.684 n=10+10) ``` Resolves cockroachdb#83801. Release note: None Co-authored-by: Erik Grinaker <[email protected]>
- Loading branch information
Showing
12 changed files
with
164 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.