Repository navigation
fix(query): pass real indexes to optimizer for index hints (issue #30) - #69
Merged
Merged
Conversation
Issue: PatternMatcher ignores indexes, always does full scan - Add indexes field to DatalogExecutor, populate from storage on creation - Pass real indexes to optimizer::plan() instead of empty Indexes::new() - Add indexes field to PatternMatcher for future index-guided lookups - Note: actual index-guided lookup implementation is Phase 6.2 work This fixes the issue where optimizer-generated index hints were being ignored.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #69 +/- ##
==========================================
+ Coverage 84.34% 84.50% +0.16%
==========================================
Files 25 25
Lines 4394 4402 +8
==========================================
+ Hits 3706 3720 +14
+ Misses 688 682 -6
🚀 New features to boost your workflow:
|
This was referenced Apr 3, 2026
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.
Summary
indexesfield toDatalogExecutor, populated fromstorage.pending_indexes_snapshot()on creationoptimizer::plan()instead of emptyIndexes::new()indexesfield toPatternMatcherfor future index-guided lookups (Phase 6.2)This fixes the issue where the optimizer generated index hints but they were being ignored because the matcher always received empty indexes.
Note: The actual index-guided lookup implementation (using the indexes to do selective scans instead of full scans) is Phase 6.2 work. This change ensures index hints are no longer ignored.