mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 15:42:48 -05:00
database tuning
This commit is contained in:
@ -32,13 +32,11 @@ BEGIN
|
||||
LEFT JOIN
|
||||
[dbo].[User] U ON U.[Id] = OU.[UserId]
|
||||
WHERE
|
||||
CU.[CollectionId] IS NOT NULL
|
||||
OR CG.[CollectionId] IS NOT NULL
|
||||
OR (
|
||||
OU.[OrganizationId] = @OrganizationId
|
||||
AND (
|
||||
OU.[AccessAll] = 1
|
||||
OR G.[AccessAll] = 1
|
||||
)
|
||||
OU.[OrganizationId] = @OrganizationId
|
||||
AND (
|
||||
CU.[CollectionId] IS NOT NULL
|
||||
OR CG.[CollectionId] IS NOT NULL
|
||||
OR OU.[AccessAll] = 1
|
||||
OR G.[AccessAll] = 1
|
||||
)
|
||||
END
|
@ -21,3 +21,8 @@ CREATE NONCLUSTERED INDEX [IX_OrganizationUser_UserIdOrganizationIdStatus]
|
||||
ON [dbo].[OrganizationUser]([UserId] ASC, [OrganizationId] ASC, [Status] ASC)
|
||||
INCLUDE ([AccessAll]);
|
||||
|
||||
|
||||
GO
|
||||
CREATE NONCLUSTERED INDEX [IX_OrganizationUser_OrganizationId]
|
||||
ON [dbo].[OrganizationUser]([OrganizationId] ASC);
|
||||
|
||||
|
Reference in New Issue
Block a user