mirror of
https://github.com/GSA/notifications-api.git
synced 2026-01-31 23:26:23 -05:00
Stop searching the to field
We were doing this temporarily while the `normalised_to` field was not populated for letters. Once we have a week of data in the `normalised_to` field we can stop looking in the `to` field. This should improve performance because: - it’s one `WHERE` clause not two - we had to do `ilike` on the `to` field, because we don’t lowercase its contents – even if the two where clauses are somehow paralleized it’s is slower than a `like` comparison, which is case-sensitive Depends on: - [ ] Tuesday 5 May (7 full days after deploying https://github.com/alphagov/notifications-api/pull/2814)
This commit is contained in:
@@ -622,7 +622,6 @@ def dao_get_notifications_by_recipient_or_reference(service_id, search_term, not
|
||||
filters = [
|
||||
Notification.service_id == service_id,
|
||||
or_(
|
||||
Notification.to.ilike("%{}%".format(search_term)),
|
||||
Notification.normalised_to.like("%{}%".format(normalised)),
|
||||
Notification.client_reference.ilike("%{}%".format(search_term)),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user