相关疑难解决方法(0)

为什么在插入索引表时没有获得最少的日志记录

我正在测试不同场景中的最少日志记录插入,并且从我读到的 INSERT INTO SELECT 到带有非聚集索引的堆中,使用 TABLOCK 和 SQL Server 2016+ 应该最少记录,但是在我的情况下,这样做时我得到完整记录。我的数据库处于简单恢复模型中,我成功地在没有索引和 TABLOCK 的堆上获得了最少记录的插入。

我正在使用 Stack Overflow 数据库的旧备份进行测试,并使用以下架构创建了 Posts 表的副本...

CREATE TABLE [dbo].[PostsDestination](
    [Id] [int] NOT NULL,
    [AcceptedAnswerId] [int] NULL,
    [AnswerCount] [int] NULL,
    [Body] [nvarchar](max) NOT NULL,
    [ClosedDate] [datetime] NULL,
    [CommentCount] [int] NULL,
    [CommunityOwnedDate] [datetime] NULL,
    [CreationDate] [datetime] NOT NULL,
    [FavoriteCount] [int] NULL,
    [LastActivityDate] [datetime] NOT NULL,
    [LastEditDate] [datetime] NULL,
    [LastEditorDisplayName] [nvarchar](40) NULL,
    [LastEditorUserId] [int] NULL,
    [OwnerUserId] [int] NULL,
    [ParentId] [int] NULL,
    [PostTypeId] [int] NOT NULL,
    [Score] [int] NOT NULL,
    [Tags] …
Run Code Online (Sandbox Code Playgroud)

sql-server transaction-log

14
推荐指数
2
解决办法
1690
查看次数

标签 统计

sql-server ×1

transaction-log ×1