Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AR-2515] Change searching username/email from case-insensitive regex to collation #15

Open
wants to merge 1 commit into
base: sa_patches_3.17.0-sa.5__reinstate_patch___Remove_header_X-Content-Type-Options_nosniff
Choose a base branch
from

Conversation

kapcod
Copy link

@kapcod kapcod commented Mar 9, 2022

Case insensitive regex cannot leverage index, collation search, however can leverage respective collation index and so instead of fullscan this query will find the user immediately
generateUsernameSuggestion: previously it tried to reduce number of iterations by checking how many nicks were already created like this. However, this search has to do fulltable scan, while a single username search is efficient, so better to always iterate from 1. Thought for the future, maybe it's better to just do random of 1000 instead of consecutive number.

Case insensitive regex cannot leverage index, collation search, however can leverage respective collation index and so instead of fullscan this query will find the user immediately
generateUsernameSuggestion: previously it tried to reduce number of iterations by checking how many nicks were already created like this. However, this search has to do fulltable scan, while a single username search is efficient, so better to always iterate from 1. Thought for the future, maybe it's better to just do random of 1000 instead of consecutive number.
@kapcod kapcod requested a review from nmagedman March 9, 2022 16:03
@kapcod kapcod requested a review from alexkoval March 9, 2022 16:05
@kapcod kapcod changed the title Change searching username/email from case-insensitive regex to collation [AR-2515] Change searching username/email from case-insensitive regex to collation Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants