Skip to content

fix: optimize member identity queries to use VALUES clause joins#3820

Merged
skwowet merged 4 commits intomainfrom
hotfix-data-sink-worker
Feb 3, 2026
Merged

fix: optimize member identity queries to use VALUES clause joins#3820
skwowet merged 4 commits intomainfrom
hotfix-data-sink-worker

Conversation

@skwowet
Copy link
Copy Markdown
Collaborator

@skwowet skwowet commented Feb 3, 2026

Summary

Refactored findAlreadyExistingVerifiedIdentities, findMembersByVerifiedEmails, and findMembersByVerifiedUsernames to use VALUES clause joins instead of IN/OR conditions.

Changes

  • Use VALUES clause joins to leverage idx_memberIdentities_platform_type_lower_value_memberId index
  • Add type filter to findAlreadyExistingVerifiedIdentities for proper index usage
  • Apply lower() on value comparisons to match index definition

Note

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, and findMembersByVerifiedUsernames to build an input VALUES CTE and JOIN against memberIdentities, replacing dynamically-generated OR/IN filters.

The lookups now include type in the join keys where applicable and perform case-insensitive matching via lower(mi.value) (and lowercased input), plus early returns for empty input arrays. findMembersByIdentities is 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.

@skwowet skwowet self-assigned this Feb 3, 2026
@skwowet skwowet requested a review from themarolt February 3, 2026 12:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

2 similar comments
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Feb 3, 2026

⚠️ Jira Issue Key Missing

Your PR title doesn't contain a Jira issue key. Consider adding it for better traceability.

Example:

  • feat: add user authentication (CM-123)
  • feat: add user authentication (IN-123)

Projects:

  • CM: Community Data Platform
  • IN: Insights

Please add a Jira issue key to your PR title.

@skwowet skwowet merged commit 4f3891f into main Feb 3, 2026
15 checks passed
@skwowet skwowet deleted the hotfix-data-sink-worker branch February 3, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants