3
由于varchar(max),将溢出溢出排序到tempdb
在具有32GB的服务器上,我们正在运行SQL Server 2014 SP2,最大内存为25GB,我们有两个表,在这里您可以找到两个表的简化结构: CREATE TABLE [dbo].[Settings]( [id] [int] IDENTITY(1,1) NOT NULL, [resourceId] [int] NULL, [typeID] [int] NULL, [remark] [varchar](max) NULL, CONSTRAINT [PK_Settings] PRIMARY KEY CLUSTERED ([id] ASC) ) ON [PRIMARY] GO CREATE TABLE [dbo].[Resources]( [id] [int] IDENTITY(1,1) NOT NULL, [resourceUID] [int] NULL, CONSTRAINT [PK_Resources] PRIMARY KEY CLUSTERED ([id] ASC) …