mirror of
https://github.com/bitwarden/server
synced 2026-01-17 16:03:49 +00:00
refactor cipher queries by user. tuned indexing.
This commit is contained in:
@@ -16,12 +16,7 @@
|
||||
|
||||
|
||||
GO
|
||||
CREATE NONCLUSTERED INDEX [IX_Cipher_OrganizationId_Type]
|
||||
ON [dbo].[Cipher]([OrganizationId] ASC, [Type] ASC) WHERE ([OrganizationId] IS NOT NULL);
|
||||
|
||||
|
||||
GO
|
||||
CREATE NONCLUSTERED INDEX [IX_Cipher_UserId_Type_IncludeAll]
|
||||
ON [dbo].[Cipher]([UserId] ASC, [Type] ASC)
|
||||
INCLUDE ([OrganizationId], [Data], [Favorites], [Folders], [Attachments], [CreationDate], [RevisionDate]);
|
||||
CREATE NONCLUSTERED INDEX [IX_Cipher_UserId_OrganizationId_IncludeAll]
|
||||
ON [dbo].[Cipher]([UserId] ASC, [OrganizationId] ASC)
|
||||
INCLUDE ([Type], [Data], [Favorites], [Folders], [Attachments], [CreationDate], [RevisionDate]);
|
||||
|
||||
|
||||
@@ -6,3 +6,10 @@
|
||||
CONSTRAINT [FK_GroupUser_OrganizationUser] FOREIGN KEY ([OrganizationUserId]) REFERENCES [dbo].[OrganizationUser] ([Id])
|
||||
);
|
||||
|
||||
|
||||
GO
|
||||
CREATE NONCLUSTERED INDEX [IX_GroupUser_OrganizationUserId]
|
||||
ON [dbo].[GroupUser]([OrganizationUserId] ASC);
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,3 +33,9 @@
|
||||
CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED ([Id] ASC)
|
||||
);
|
||||
|
||||
|
||||
GO
|
||||
CREATE NONCLUSTERED INDEX [IX_Organization_Enabled]
|
||||
ON [dbo].[Organization]([Id] ASC, [Enabled] ASC)
|
||||
INCLUDE ([UseTotp]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user