Conversation
Contributor
hvitved
commented
Aug 4, 2025
```
Evaluated relational algebra for predicate _Crate::Crate.getSourceFile/0#dispred#e7adf9d7_Crate::Generated::Crate.getName/0#dispred#f4d3b3bf_Pa__#join_rhs@5a04a7t0 with tuple counts:
34471980 ~0% {3} r1 = JOIN `PathResolution::isSourceFile/1#803de032` WITH `Crate::Crate.getSourceFile/0#dispred#e7adf9d7` CARTESIAN PRODUCT OUTPUT Rhs.0, Lhs.0, Rhs.1
34471980 ~37% {4} | JOIN WITH `Crate::Generated::Crate.getName/0#dispred#f4d3b3bf` ON FIRST 1 OUTPUT Lhs.1, Lhs.2, Rhs.1, _
{3} | REWRITE WITH NOT [Tmp.3 := "std", TEST InOut.2 != Tmp.3, Tmp.3 := "core", TEST InOut.2 != Tmp.3] KEEPING 3
93420 ~91% {3} | SCAN OUTPUT In.1, _, In.0
93420 ~87% {3} | REWRITE WITH Out.1 := "prelude"
return r1
```
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR optimizes a performance bottleneck in the Rust query language code by refactoring duplicate predicate logic to improve join efficiency. The change addresses a bad join pattern that was causing excessive tuple counts during query evaluation.
- Extracted shared logic for finding prelude items into a separate predicate
- Reordered join conditions in
preludeEdgeto optimize query performance
geoffw0
approved these changes
Aug 4, 2025
Contributor
geoffw0
left a comment
There was a problem hiding this comment.
LGTM, thanks for fixing.
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.