Skip to content

feat: Add GIN index on Identity.identifier #5369

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

Merged
merged 4 commits into from
May 15, 2025

Conversation

khvn26
Copy link
Member

@khvn26 khvn26 commented Apr 22, 2025

Thanks for submitting a PR! Please check the boxes below:

  • I have added information to docs/ if required so people know about the feature!
  • I have filled in the "Changes" section below?
  • I have filled in the "How did you test this code" section below?
  • I have used a Conventional Commit title for this Pull Request

Changes

This PR improves /api/v1/environments/{environment_api_key}/identities/ when searching through large quantities of identities.

How did you test this code?

Made sure the migration works as expected locally.

The index has been tested in staging and is working in prod for one of the enterprise customers.

@khvn26 khvn26 requested a review from a team as a code owner April 22, 2025 10:22
@khvn26 khvn26 requested review from gagantrivedi and removed request for a team April 22, 2025 10:22
Copy link

vercel bot commented Apr 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
docs ⬜️ Ignored (Inspect) Visit Preview May 14, 2025 4:20pm
flagsmith-frontend-preview ⬜️ Ignored (Inspect) Visit Preview May 14, 2025 4:20pm
flagsmith-frontend-staging ⬜️ Ignored (Inspect) Visit Preview May 14, 2025 4:20pm

@github-actions github-actions bot added api Issue related to the REST API feature New feature or request labels Apr 22, 2025
Copy link
Contributor

github-actions bot commented Apr 22, 2025

Docker builds report

Image Build Status Security report
ghcr.io/flagsmith/flagsmith-e2e:pr-5369 Finished ✅ Skipped
ghcr.io/flagsmith/flagsmith-api:pr-5369 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-frontend:pr-5369 Finished ✅ Results
ghcr.io/flagsmith/flagsmith-private-cloud:pr-5369 Finished ✅ Results
ghcr.io/flagsmith/flagsmith:pr-5369 Finished ✅ Results

Copy link
Contributor

github-actions bot commented Apr 22, 2025

Uffizzi Preview deployment-63011 was deleted.

@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels Apr 22, 2025
Copy link

codecov bot commented Apr 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.65%. Comparing base (bdb9bc1) to head (0a0bd88).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5369   +/-   ##
=======================================
  Coverage   97.65%   97.65%           
=======================================
  Files        1234     1235    +1     
  Lines       43299    43326   +27     
=======================================
+ Hits        42282    42309   +27     
  Misses       1017     1017           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

indexes = [
UnrestrictedGinIndex(
OpClass(Upper("identifier"), name="gin_trgm_ops"),
name="environments_identity_identifier_gin_idx",
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Can we shorten the index name to just identifier_gin_idx to avoid having to subclass? It's not immediately clear what UnrestrictedGinIndex means just from the class name. If we do keep that class, could we add a docstring to explain its purpose?

Copy link
Member Author

@khvn26 khvn26 May 14, 2025

Choose a reason for hiding this comment

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

Renamed the index on staging to identity_identifier_idx and fixed in 1c5aa22 + 0a0bd88 👍

@khvn26 khvn26 force-pushed the feat/add-identity-identifier-index branch from ad431e7 to 1c5aa22 Compare May 14, 2025 15:45
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels May 14, 2025
@khvn26 khvn26 requested a review from gagantrivedi May 14, 2025 15:47
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels May 14, 2025
@khvn26 khvn26 force-pushed the feat/add-identity-identifier-index branch from 55e03db to 5424560 Compare May 14, 2025 16:00
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels May 14, 2025
@khvn26 khvn26 force-pushed the feat/add-identity-identifier-index branch from 5424560 to 0a0bd88 Compare May 14, 2025 16:20
@github-actions github-actions bot added feature New feature or request and removed feature New feature or request labels May 14, 2025
@khvn26 khvn26 merged commit 31bd046 into main May 15, 2025
32 checks passed
@khvn26 khvn26 deleted the feat/add-identity-identifier-index branch May 15, 2025 10:19
khvn26 added a commit that referenced this pull request May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issue related to the REST API feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants