Add email index to contacts table and update performance test #225
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request was created by Sweep to resolve the following request by @curtisdelicata:
Continue chatting at https://sweep-chat-demo.vercel.app/c/a41001b2-9cb7-49de-8fc8-7adc5cb67797.
Purpose
This pull request adds an index on the
email
column of thecontacts
table to improve the performance of email-based searches. It also updates the existingContactSearchPerformanceTest
to verify the performance improvement.Description
AddContactsEmailIndex
that creates an index on theemail
column of thecontacts
table.Contact
model to remove the commented-outuseIndex
global scope, as the index doesn't exist yet.ContactSearchPerformanceTest
to:contacts_email_index
index exists before the testSummary
app/Models/Contact.php
to remove the commented-outuseIndex
global scopedatabase/migrations/2023_05_25_000001_add_contacts_email_index.php
to create an index on theemail
column of thecontacts
tabletests/Feature/ContactSearchPerformanceTest.php
to test the performance improvement with the new index