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.
精彩评论