我在 sql server 2012 中有一个表,它在一周内获得近 6600 万次插入。我应该在哪些列上使用索引?
create TABLE [dbo].[Details](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[WorkflowContentMetricsID] [bigint] not null,
[ContentType] [nvarchar](1000) NULL,
[SourceID] [nvarchar](2000) NULL,
[DestinationID] [nvarchar](2000) NULL,
[ParentSourceID] [nvarchar](2000) NULL,
[Title] [nvarchar](max) NULL,
[Status] [nvarchar](max) NULL,
[Debug] [nvarchar](max) NULL,
[Metadata] [nvarchar](max) NULL,
[StatusCategory] [nvarchar](max) NULL,
[SangamWorkflowRunID] [nvarchar](1000) NULL,
[StartDateTime] [nvarchar](1000) NULL,
CONSTRAINT [PK_WorkflowContentDetails] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
我使用的查询是
SELECT ID
,WorkflowContentMetricsID
,ContentType
,SourceID
,DestinationID
,ParentSourceID
,Title
,[Status]
,Debug
,Metadata
,StatusCategory
FROM WorkflowContentDetails
WHERE ContentType NOT IN ('Image' , 'EntityList')
AND SangamWorkflowRunID = @SangamWorkflowRunID
And StatusCategory in (@StatusCategory)