-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'hotfix-verifier_notification_performance'
- Loading branch information
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
modules/indicia_setup/db/version_1_36_2/201707171349_indexes.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
-- #slow script# | ||
|
||
-- Indexes improve query selectVerificationAndCommentNotifications in notify_verifications_and_comments module. | ||
CREATE INDEX ix_occurrence_comments_created_on | ||
ON occurrence_comments | ||
USING btree | ||
(created_on); | ||
|
||
CREATE INDEX ix_cache_occurrences_functional_verified_on | ||
ON cache_occurrences_functional | ||
USING btree | ||
(verified_on); | ||
|
||
-- Indexes to improve queries in verifier_notifications module | ||
CREATE INDEX ix_notifications_user_id_partial_vt | ||
ON notifications | ||
USING btree | ||
(user_id) | ||
WHERE source_type IN ('VT', 'PT') and acknowledged=false; |