Repository navigation
perf: one equality lookup no longer indexes every row - #1530
Merged
Merged
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.
Fixes #1524
A path-table answered every equality lookup by first building a
HashMap<String, Vec<usize>>over all rows (one owned key per row, on one thread). For a singleWHERE path = '...'that cost far more than the scan. Now the first probe of a column compares each row in place; the index is built only when the same cursor probes that column again, as a join's inner loop does.Timings
Tree from
glob_speed_recursive_test(320k.mdundera/b), release CLI, median of 7 by hand:SELECT count(*) FROM './a/b/**/*.md'... WHERE path = 'x'... WHERE path = 'a/b/x1/y0/z0/n4.md'New e2e case
it_finds_one_path_by_equality_within_the_bar(15 paired runs, startup subtracted):Red/green
72cd8908e2e speed case: red locally at 1.477x find (CI does not run e2e).55ba2539unit testa_single_lookup_builds_no_index: red locally (assertion failed: cursor.index.is_none()). CI could not show it red:maincurrently fails to compile lib tests (main fails to compile tests: scan_glob_rows test from #1515 predates #1513's visit argument #1525/main red: scan_glob_rows wide-directory test misses the visit argument #1526), and CI runs only on the PR.E2E Verification
cargo test --workspace --features cli)packages/python/e2e-attestations/<branch>.jsonreceipt written ifpackages/pythonchanged (just e2e-attest-python)packages/ts/e2e-attestations/<branch>.jsonreceipt written ifpackages/tschanged (just e2e-attest-ts)testing-conventions e2e attest 'uv run python -m pytest tests/e2e/glob_speed_recursive_test.py tests/e2e/use_case_join_test.py -x -q';testing-conventions e2e attest 'pnpm test:e2e';cargo test --workspace --features cliscan_glob_rowswide-directory test that breaksmain(main fails to compile tests: scan_glob_rows test from #1515 predates #1513's visit argument #1525).