Skip to content

Conversation

stephencdaly
Copy link
Contributor

What problem does this pull request solve?

Add GIN indexes on LOWER(name) and LOWER(email) to the users table to optimize searches using the name and email filters on the users index page. Performance isn't currently an issue for these searches, but adding these indexes should ensure they remain performant as more users sign up.

We need to ensure that the forms-admin user has the rds_extension role in order for the migration with enable_extension "pg_trgm" to run. We also need to ensure that pg_trgm is in the rds.allowed_delegated_extensions for the database.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

Add a GIN index on LOWER(name) to optimize case-insensitive searches
for users.
Add a GIN index on LOWER(email) to optimize case-insensitive searches
for users.

We already have a unique index on email but we cannot make gin indexes
unique so we need to add a separate index for searches.
Copy link

Copy link

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-2240.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

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.

1 participant