叢集索引插入 Showplan 運算子

Clustered Index Insert 執行程序表運算子會將其輸入的資料列插入 Argument 資料行所指定的叢集索引中。Argument 資料行也包含 SET:() 述詞,指出每一個資料行設定的值。如果 Clustered Index Insert 沒有插入值的子系,則會從 Insert 運算子本身取得插入的資料列。

Clustered Index Insert 是實體運算子。

叢集索引插入運算子圖示圖形化執行計畫圖示

範例

下列範例會將資料列插入具有叢集索引的資料表。執行計畫的輸出顯示,查詢最佳化工具會使用 Clustered Index Insert 運算子來插入資料列。

USE AdventureWorks2008R2;
GO
SET NOCOUNT ON;
GO
SET SHOWPLAN_ALL ON;
GO
INSERT INTO Production.UnitMeasure
VALUES (N'F2', N'Square Feet', GETDATE());
GO

Clustered Index Insert 運算子的執行計畫輸出如底下所示。

PhysicalOp

-----------------------------------------------------------------------

Clustered Index Insert

Argument

-----------------------------------------------------------------------

OBJECT:([AdventureWorks2008R2].[Production].[UnitMeasure].[PK_UnitMeasure_UnitMeasureCode]),

OBJECT:([AdventureWorks2008R2].[Production].[UnitMeasure].[AK_UnitMeasure_Name]),

SET:([AdventureWorks2008R2].[Production].[UnitMeasure].[UnitMeasureCode] =

RaiseIfNull([Expr1003]),[AdventureWorks2008R2].[Production].[UnitMeasure].[Name] =

RaiseIfNull([Expr1004]),[AdventureWorks2008R2].[Production].[UnitMeasure].[ModifiedDate] = RaiseIfNull(getdate())),

DEFINE:([Expr1003]=CONVERT_IMPLICIT(nchar(3),[@1],0),

[Expr1004]=CONVERT_IMPLICIT(nvarchar(50),[@2],0), [ConstExpr1006]=getdate())