У меня есть простая таблица, и я оцениваю, как лучше всего удалить из нее некоторые записи.
Запрос DELETE очень прост: DELETE FROM [dbo].[Badge] WHERE [Id_Operatore] = @SOMEVALUE
Есть ли способ повысить производительность этой операции?
Это таблица:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Badge](
[Id_Badge] [int] IDENTITY(1,1) NOT NULL,
[Id_Operatore] [int] NULL,
[Badge0] [smallint] NULL,
[Badge1] [smallint] NULL,
[Badge2] [smallint] NULL,
[Badge3] [smallint] NULL,
[Badge4] [smallint] NULL,
[Badge5] [smallint] NULL,
[Badge6] [smallint] NULL,
[Badge7] [smallint] NULL,
[Badge8] [smallint] NULL,
[Badge9] [smallint] NULL,
[Badge10] [smallint] NULL,
[Badge11] [smallint] NULL,
[Badge12] [smallint] NULL,
[Badge13] [smallint] NULL,
[Badge14] [smallint] NULL,
[Badge15] [smallint] NULL,
[Badge16] [smallint] NULL,
[Badge17] [smallint] NULL,
[Badge18] [smallint] NULL,
[Badge19] [smallint] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Badge] WITH CHECK ADD CONSTRAINT [Badge_FK00] FOREIGN KEY([Id_Operatore])
REFERENCES [dbo].[Operatori] ([ID_Operatore])
ON UPDATE CASCADE
ON DELETE CASCADE
GO
ALTER TABLE [dbo].[Badge] CHECK CONSTRAINT [Badge_FK00]
GO