perf(table): elide identity partition filters - #1966
Open
fallintoplace wants to merge 2 commits into
Open
Conversation
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
tenant_id = acme AND amount > 100becomesamount > 100.AlwaysTrueresiduals do not read filter-only columns.Why
Local scans already use task residuals while reading, but local planning left them nil. This made files re-evaluate predicates already proven by identity partition values.
Benchmark
Planning overhead
Command:
go test ./table -run '^$' -bench '^BenchmarkPartitionResidualPlanning$' -benchmem -count=5Apple M1 Pro:
0.866 to 0.897 ms/opfor 4,096 files425,984 B/op16,384 allocs/opThis measures residual planning overhead only.
Arrow read path
Command:
go test ./table -run '^$' -bench '^BenchmarkArrowScanTaskResidual$' -benchmem -count=5Apple M1 Pro, 32,768-row Parquet file, projecting
payloadonly:2.75 ms/op,8.98 MB/op,946 allocs/opAlwaysTrueresidual: about1.55 ms/op,5.55 MB/op,520 allocs/op3.52 ms/op,19.86 MB/op,1,833 allocs/opamount > 100residual: about3.02 ms/op,17.33 MB/op,1,488 allocs/opThe read benchmark compares the original filter path with the task residuals produced by this PR.
Checks
go test ./table -count=1go test -race ./table -count=1/Users/hoangvu/go/bin/golangci-lint run ./table/... --timeout=5m