Skip to content

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

Open
kapcod wants to merge 1 commit intosa_patches_3.17.0-sa.5__reinstate_patch___Remove_header_X-Content-Type-Options_nosnifffrom
sa_patches_3.17.0-sa.6__improve_user_search
Open

[AR-2515] Change searching username/email from case-insensitive regex to collation#15
kapcod wants to merge 1 commit intosa_patches_3.17.0-sa.5__reinstate_patch___Remove_header_X-Content-Type-Options_nosnifffrom
sa_patches_3.17.0-sa.6__improve_user_search

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

Development

Successfully merging this pull request may close these issues.

2 participants