refactor: multiple feats and fixes#117
Merged
Merged
Conversation
Signed-off-by: usamoi <usamoi@outlook.com>
Signed-off-by: usamoi <usamoi@outlook.com>
There was a problem hiding this comment.
Pull request overview
This PR tightens bm25 query/index correctness and expands configurability by adding per-index prefilter reloptions (with GUC fallback behavior), while also refactoring bm25 index build code paths and extending sqllogictest coverage.
Changes:
- Add a
RelationIdtrait and wire it through scanner builders so abm25querycan validate it’s used with the intended index. - Introduce
prefilteras a bm25 index reloption and update GUC handling to fall back to reloptions when the GUC is default. - Refactor bm25 index build implementation to consolidate sequential/parallel build logic; add/extend sqllogictest cases.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sqllogictest/fallback_parameter.slt | Adds coverage for prefilter reloption affecting filtered queries under a low bm25 limit. |
| tests/sqllogictest/bm25query.slt | New test ensuring to_bm25query(..., index_name) errors if the planner uses a different (e.g., partial) bm25 index. |
| src/lib.rs | Adds a main-process assertion for temporary-name generation. |
| src/index/storage.rs | Implements RelationId for PostgresRelation using the underlying relation OID. |
| src/index/scanners.rs | Requires RelationId for SearchBuilder::new so builders can capture the index identity. |
| src/index/gucs.rs | Adds config pointer tracking for bm25.prefilter and implements GUC-vs-reloption precedence for bm25_prefilter. |
| src/index/bm25/scanners/default.rs | Captures index OID in the builder and validates the bm25query.index matches the scan’s index. |
| src/index/bm25/am/mod.rs | Adds prefilter to bm25 reloptions parsing/registration and wires bm25_prefilter(relation) into scan options. |
| src/index/bm25/am/am_build.rs | Refactors parallel/sequential build into a shared build function and factors out DSM path parsing. |
| crates/index/src/relation.rs | Introduces the RelationId trait in the index crate API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: usamoi <usamoi@outlook.com>
70b2955 to
abd7040
Compare
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.
No description provided.