Skip to content

Instantly share code, notes, and snippets.

@afscrome
Created March 11, 2016 10:25
Show Gist options
  • Save afscrome/49d48dc9d5a028befdbd to your computer and use it in GitHub Desktop.
Save afscrome/49d48dc9d5a028befdbd to your computer and use it in GitHub Desktop.
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.2" Build="11.0.5343.0">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementText="CREATE PROCEDURE nre_repo&#xD;&#xA;AS&#xD;&#xA;BEGIN&#xD;&#xA;&#x9;CREATE TABLE #replies ( Id int NOT NULL PRIMARY KEY );&#xD;&#xA;&#xD;&#xA;" StatementId="1" StatementCompId="52" StatementType="CREATE TABLE" RetrievedFromCache="true" />
<StmtSimple StatementText="&#x9;Insert Into #replies&#xD;&#xA;&#x9;exec sp_executesql N'select 1'&#xD;&#xA;&#xD;&#xA;" StatementId="2" StatementCompId="53" StatementType="INSERT EXEC" RetrievedFromCache="true" StatementSubTreeCost="0.0132841" StatementEstRows="1" StatementOptmLevel="TRIVIAL" QueryHash="0xD6FBD67832A8F4DD" QueryPlanHash="0xD754250DFD9DD669">
<StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false" />
<QueryPlan CachedPlanSize="16" CompileTime="0" CompileCPU="0" CompileMemory="88">
<MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" />
<OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="288343" EstimatedPagesCached="360429" EstimatedAvailableDegreeOfParallelism="10" />
<RelOp NodeId="0" PhysicalOp="Clustered Index Insert" LogicalOp="Insert" EstimateRows="1" EstimateIO="0.01" EstimateCPU="1e-006" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0132841" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row">
<OutputList />
<Update DMLRequestSort="0">
<Object Database="[tempdb]" Schema="[dbo]" Table="[#replies]" Index="[PK__#replies__3214EC072019D642]" />
<SetPredicate>
<ScalarOperator ScalarString="[#replies].[Id] = RaiseIfNullInsert([Parameter Table].[Id] as [ParameterTable].[Id])">
<ScalarExpressionList>
<ScalarOperator>
<MultipleAssign>
<Assign>
<ColumnReference Table="[#replies]" Column="Id" />
<ScalarOperator>
<Intrinsic FunctionName="RaiseIfNullInsert">
<ScalarOperator>
<Identifier>
<ColumnReference Table="[Parameter Table]" Alias="[ParameterTable]" Column="Id" />
</Identifier>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</Assign>
</MultipleAssign>
</ScalarOperator>
</ScalarExpressionList>
</ScalarOperator>
</SetPredicate>
<RelOp NodeId="1" PhysicalOp="Parameter Table Scan" LogicalOp="Parameter Table Scan" EstimateRows="1" EstimateIO="0.0032035" EstimateCPU="7.96e-005" AvgRowSize="11" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row">
<OutputList>
<ColumnReference Table="[Parameter Table]" Alias="[ParameterTable]" Column="Id" />
</OutputList>
<ParameterTableScan />
</RelOp>
</Update>
</RelOp>
</QueryPlan>
</StmtSimple>
<StmtSimple StatementId="2" StatementCompId="53" StatementType="EXECUTE PROC" RetrievedFromCache="true" />
<StmtSimple StatementText="&#x9;drop table #replies&#xD;" StatementId="3" StatementCompId="54" StatementType="DROP OBJECT" RetrievedFromCache="true" />
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment