开发者

SQL Server Indexing

开发者 https://www.devze.com 2022-12-28 15:15 出处:网络
I am trying to unde开发者_StackOverflow中文版rstand what is going on with CREATE INDEX internally. When I create a NONCLUSTERED index it shows as an INSERT in the execution plan as well as when I get

I am trying to unde开发者_StackOverflow中文版rstand what is going on with CREATE INDEX internally. When I create a NONCLUSTERED index it shows as an INSERT in the execution plan as well as when I get the query test.

DECLARE @sqltext VARBINARY(128)
SELECT @sqltext = sql_handle
FROM sys.sysprocesses s
WHERE spid = 73 --73 is the process creating the index
SELECT TEXT
FROM sys.dm_exec_sql_text(@sqltext)
GO

Show:

insert [dbo].[tbl] select * from [dbo].[tbl] option (maxdop 1)

This is consistent in the execution plan. Any info is appreciated.


This was my lack of knowledge on indexes, what a difference 4 months of experience makes! :)

The index creation will cause writes to the index to insert the leafs as needed.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号