fix(engine): plan cache Put/Get keys after Optimise (#238) - #263
Open
MrBeldum wants to merge 3 commits into
Open
fix(engine): plan cache Put/Get keys after Optimise (#238)#263MrBeldum wants to merge 3 commits into
MrBeldum wants to merge 3 commits into
Conversation
Dedupe mutates the query in place, so Get(raw) and Put(deduped) disagreed for any duplicate-keyword recall and the entry was never hit. Optimise first, then use one key for both Put and Get. Fixes FraiseHQ#238
|
Thanks for the contribution! Before it can be merged, please read the CLA and comment exactly: I have read the CLA and I hereby agree to its terms You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
10 tasks
|
Thanks for the contribution. Before this can be merged, the following need to sign the CLA: To sign, post a comment on this pull request containing exactly: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Collaborator
|
Thanks for your PR @MrBeldum , could you use the PR template in the repo for your PR description and have a look at the CLA? |
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
Dedupe.Optimisemutates the query in place, soPlanpreviously hashed the raw query forGetand the deduplicated query forPut. Any recall with a repeated keyword/topic/entity was stored under a key that was never looked up.PutandGet.recall@0 foo foo top:5must hit the cached query from the firstPlan.Fixes #238
Test plan
go test ./pkg/engine/ -count=1