Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR modifies the planner to use the stream.PkScan operator when possible.
This operator behaves like an index but is faster and space efficient because it uses
the table tree rather than a separate index tree.
Benchmarks:
Before
After
Benchstat:
$ benchstat old.txt new.txt name old time/op new time/op delta SelectPk/00001-12 17.0µs ± 3% 17.6µs ± 5% ~ (p=0.056 n=5+5) SelectPk/00010-12 19.0µs ± 2% 17.4µs ± 2% -8.49% (p=0.008 n=5+5) SelectPk/00100-12 97.1µs ± 2% 22.2µs ± 2% -77.10% (p=0.008 n=5+5) SelectPk/01000-12 888µs ± 2% 22µs ± 1% -97.52% (p=0.008 n=5+5) SelectPk/10000-12 9.18ms ± 3% 0.02ms ± 4% -99.76% (p=0.008 n=5+5) name old alloc/op new alloc/op delta SelectPk/00001-12 4.18kB ± 0% 4.63kB ± 0% +10.73% (p=0.016 n=4+5) SelectPk/00010-12 5.22kB ± 0% 4.63kB ± 0% -11.34% (p=0.008 n=5+5) SelectPk/00100-12 15.7kB ± 0% 4.6kB ± 0% -70.47% (p=0.008 n=5+5) SelectPk/01000-12 138kB ± 0% 5kB ± 0% -96.64% (p=0.008 n=5+5) SelectPk/10000-12 1.37MB ± 0% 0.00MB ± 0% -99.66% (p=0.008 n=5+5) name old allocs/op new allocs/op delta SelectPk/00001-12 90.0 ± 0% 95.0 ± 0% +5.56% (p=0.008 n=5+5) SelectPk/00010-12 135 ± 0% 95 ± 0% -29.63% (p=0.008 n=5+5) SelectPk/00100-12 585 ± 0% 95 ± 0% -83.76% (p=0.008 n=5+5) SelectPk/01000-12 6.83k ± 0% 0.10k ± 0% -98.58% (p=0.008 n=5+5) SelectPk/10000-12 69.8k ± 0% 0.1k ± 0% -99.86% (p=0.008 n=5+5)