在什么情况下可以插入一个简单的记录(表有大约 10 列,其中两个是 xml)使用并行性?
CREATE TABLE [dbo].[PackageSessions](
[PackageSessionId] [int] IDENTITY(1,1) NOT NULL,
[PackageId] [int] NOT NULL,
[UserId] [int] NOT NULL,
[StartDateTime] [datetime] NULL,
[StopDateTime] [datetime] NULL,
[Score] [float] NOT NULL,
[ScoreMax] [float] NOT NULL,
[CompletionStatus] [int] NOT NULL,
[ReviewPlayerContextId] [int] NOT NULL,
[PlayerContextId] [int] NOT NULL,
[ReducedScore] [float] NOT NULL,
[ReducedScoreMax] [float] NOT NULL,
[PackageSnapShot] [xml] NULL,
[InterfaceLanguageId] [int] NOT NULL,
[Data] [xml] NULL,
[PackageSessionLanguageId] [int] NOT NULL,
CONSTRAINT [PackageSessions_PK] PRIMARY KEY CLUSTERED
(
[PackageSessionId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
插入一个简单的直接记录,例如:
永远不会被并行化。SQL Server 检测可以在哪里拆分作业,例如,如果您正在对表进行更新,它可能会将表分成两半并将每一半分配给两个不同的处理器。如果作业不能相当容易地拆分,它会在没有并行化的情况下运行。
(Schema-Nazi 注意:表名应该是单一的)