diff --git a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj index 5b4022af..579dc74a 100644 --- a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj +++ b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj @@ -640,4 +640,7 @@ + + + \ No newline at end of file diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-7133_AddIndexUserUserGroup.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-7133_AddIndexUserUserGroup.sql new file mode 100644 index 00000000..00d89d0d --- /dev/null +++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/TD-7133_AddIndexUserUserGroup.sql @@ -0,0 +1,6 @@ +IF NOT EXISTS(SELECT * FROM sys.indexes WHERE name='IX_UserUserGroup_UserId_Deleted' AND object_id = OBJECT_ID('[hub].[UserUserGroup]')) +BEGIN +CREATE INDEX IX_UserUserGroup_UserId_Deleted +ON hub.UserUserGroup (UserId, Deleted) +INCLUDE (UserGroupId) WITH (FILLFACTOR = 95); +END \ No newline at end of file