Add lc_package columns to avoid timeout/deadlock#440
Closed
charsbar wants to merge 4 commits intoandk:masterfrom
Closed
Add lc_package columns to avoid timeout/deadlock#440charsbar wants to merge 4 commits intoandk:masterfrom
charsbar wants to merge 4 commits intoandk:masterfrom
Conversation
wolfsage
reviewed
Apr 26, 2024
| primeur => qq{SELECT package, | ||
| userid | ||
| FROM primeur where LOWER(package) = LOWER(?)}, | ||
| FROM primeur where lc_package = LOWER(?)}, |
Collaborator
There was a problem hiding this comment.
Any reason you left LOWER(?) in this one place but changed all others to use lc?
Collaborator
Author
There was a problem hiding this comment.
@wolfsage because the first query (SELECT modid, userid FROM mods where modid = ?) requires raw module name, and the latter query requires lower cased module name. Do you think we should also add lc_modid to the mods table so that we can use lc $m below?
Collaborator
Author
There was a problem hiding this comment.
Or it might be better to repeat selectrow_arrayref without the for loop.
Collaborator
There was a problem hiding this comment.
Ah, I see. I think leaving LOWER(?) here is fine then
wolfsage
approved these changes
Apr 26, 2024
Collaborator
wolfsage
left a comment
There was a problem hiding this comment.
I think this is fine. I have two thoughts:
- If we used a case insensitive colation for lc_package, we wouldn't have to remember to compare with
lc $vareach time, which maybe provides a little less risk - If we want to test this more before deploy we can stand this up on a DO box and do some manual testing (if we haven't already)
Owner
|
Thanks, applied and deployed just now |
This was referenced Apr 26, 2024
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.
This PR is another fix for #406. Contrary to #424, which removes
LOWER()so that PAUSE can use indices (but lose case-insensitivity), this PR adds indexed lc_package columns to keep the current case-insensitive search and let PAUSE use indices at the cost of some extra space.We may need to replace some more for the web app, but I haven't thoroughly checked yet. Also, we may need to add a unique lc_pack_user index (or replace pack_user with lc_pack_user), but I'm still wondering which is better.
If you try this PR before merging, apply one-off-utils/schemachange-2024-04.sql.