fix: optimize member identity queries to use VALUES clause joins#3820
fix: optimize member identity queries to use VALUES clause joins#3820
Conversation
…se for improved performance
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
2 similar comments
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
|
Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability. Example:
Projects:
Please add a Jira issue key to your PR title. |
Summary
Refactored
findAlreadyExistingVerifiedIdentities,findMembersByVerifiedEmails, andfindMembersByVerifiedUsernamesto use VALUES clause joins instead of IN/OR conditions.Changes
idx_memberIdentities_platform_type_lower_value_memberIdindexfindAlreadyExistingVerifiedIdentitiesfor proper index usagelower()on value comparisons to match index definitionNote
Medium Risk
Changes SQL matching semantics to case-insensitive comparisons and modifies join keys (including
type), which can affect which members are returned even though the change is localized to lookup queries.Overview
Refactors
findAlreadyExistingVerifiedIdentities,findMembersByVerifiedEmails, andfindMembersByVerifiedUsernamesto build an inputVALUESCTE andJOINagainstmemberIdentities, replacing dynamically-generatedOR/INfilters.The lookups now include
typein the join keys where applicable and perform case-insensitive matching vialower(mi.value)(and lowercased input), plus early returns for empty input arrays.findMembersByIdentitiesis also adjusted to compare identity values case-insensitively (lower(mi.value) = lower(i.value)).Written by Cursor Bugbot for commit df9fc6e. This will update automatically on new commits. Configure here.