Skip to content

fix: added missing index#3950

Merged
themarolt merged 3 commits intomainfrom
data-sink-worker-missing-index
Mar 24, 2026
Merged

fix: added missing index#3950
themarolt merged 3 commits intomainfrom
data-sink-worker-missing-index

Conversation

@themarolt
Copy link
Copy Markdown
Contributor

@themarolt themarolt commented Mar 24, 2026

Note

Medium Risk
Introduces a new concurrent partial index on memberIdentities, which can impact migration runtime and database load on large tables but is otherwise isolated to query performance.

Overview
Improves performance of email identity joins by adding a concurrent partial B-tree index on memberIdentities(lower(value)) scoped to verified = true, type = 'email', and non-deleted rows.

Adds the corresponding down migration to drop idx_memberIdentities_verified_email_lower_value if present.

Written by Cursor Bugbot for commit 57cfebd. This will update automatically on new commits. Configure here.

Signed-off-by: Uroš Marolt <uros@marolt.me>
Copilot AI review requested due to automatic review settings March 24, 2026 14:42
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ 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

⚠️ 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

⚠️ 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a targeted B-tree partial index to speed up equality lookups on verified, non-deleted email identities (where the existing trigram GIN index is not well-suited for = predicates).

Changes:

  • Add a concurrent B-tree partial index on memberIdentities(lower(value)) scoped to verified = true, type = 'email', and "deletedAt" IS NULL.
  • Add an undo migration to drop the new index concurrently.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
backend/src/database/migrations/V1774363114__add-btree-index-for-member-identities-email-lookup.sql Creates the new concurrent partial B-tree index intended for verified-email equality lookups.
backend/src/database/migrations/U1774363114__add-btree-index-for-member-identities-email-lookup.sql Drops the newly added index concurrently for rollback/undo scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link
Copy Markdown
Contributor

⚠️ 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.

1 similar comment
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ 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.

… backend/

Signed-off-by: Uroš Marolt <uros@marolt.me>
@themarolt themarolt force-pushed the data-sink-worker-missing-index branch from 9169c64 to 57cfebd Compare March 24, 2026 15:44
@github-actions
Copy link
Copy Markdown
Contributor

⚠️ 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.

@themarolt themarolt merged commit 657e05b into main Mar 24, 2026
14 checks passed
@themarolt themarolt deleted the data-sink-worker-missing-index branch March 24, 2026 15:51
skwowet pushed a commit that referenced this pull request Mar 25, 2026
Signed-off-by: Uroš Marolt <uros@marolt.me>
Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
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