add batch remove batch split batch show hidden batches hide batch
db<>fiddle
feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
4 rows affected
company_id id name
A 2 customer A2
B 2 customer A2
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.481" Build="14.0.3335.7"><BatchSequence><Batch><Statements><StmtSimple StatementText="select company_id, id, name&#xa;from (&#xa; select company_id, id, name from dbo.vcustA&#xa; union all&#xa; select company_id, id, name from dbo.vcustB&#xa; ) x&#xa;where id = 2" StatementId="1" StatementCompId="2" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="0.0065666" StatementEstRows="2" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x4E3E74624AE45BEC" QueryPlanHash="0xCA8EF9975C781A30" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="140"><StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false"></StatementSetOptions><QueryPlan DegreeOfParallelism="0" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="24" CompileTime="15" CompileCPU="15" CompileMemory="232"><MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="838808" EstimatedPagesCached="52425" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="2259400"></OptimizerHardwareDependentProperties><TraceFlags IsCompileTime="1"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="460" Scope="Global"></TraceFlag><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><QueryTimeStats ElapsedTime="0" CpuTime="0"></QueryTimeStats><RelOp NodeId="0" PhysicalOp="Concatenation" LogicalOp="Concatenation" EstimateRows="2" EstimateIO="0" EstimateCPU="2e-007" AvgRowSize="67" EstimatedTotalSubtreeCost="0.0065666" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Union1006"></ColumnReference><ColumnReference Column="Union1007"></ColumnReference><ColumnReference Column="Union1008"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Concat><DefinedValues><DefinedValue><ColumnReference Column="Union1006"></ColumnReference><ColumnReference Column="Expr1002"></ColumnReference><ColumnReference Column="Expr1005"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Column="Union1007"></ColumnReference><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="id"></ColumnReference><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="id"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Column="Union1008"></ColumnReference><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="name"></ColumnReference><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="name"></ColumnReference></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="67" EstimatedTotalSubtreeCost="0.0032832" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="id"></ColumnReference><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="name"></ColumnReference><ColumnReference Column="Expr1002"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1002"></ColumnReference><ScalarOperator ScalarString="&apos;A&apos;"><Const ConstValue="&apos;A&apos;"></Const></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="2" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimatedRowsRead="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="65" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="2" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="id"></ColumnReference><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="name"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="id"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="name"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Index="[PK__custA__3213E83FE151B5F4]" IndexKind="Clustered" Storage="RowStore"></Object><SeekPredicates><SeekPredicateNew><SeekKeys><Prefix ScanType="EQ"><RangeColumns><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custA]" Column="id"></ColumnReference></RangeColumns><RangeExpressions><ScalarOperator ScalarString="(2)"><Const ConstValue="(2)"></Const></ScalarOperator></RangeExpressions></Prefix></SeekKeys></SeekPredicateNew></SeekPredicates></IndexScan></RelOp></ComputeScalar></RelOp><RelOp NodeId="3" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="1e-007" AvgRowSize="67" EstimatedTotalSubtreeCost="0.0032832" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="id"></ColumnReference><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="name"></ColumnReference><ColumnReference Column="Expr1005"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1005"></ColumnReference><ScalarOperator ScalarString="&apos;B&apos;"><Const ConstValue="&apos;B&apos;"></Const></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="4" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimatedRowsRead="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="65" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="2" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="id"></ColumnReference><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="name"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="id"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="name"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Index="[PK__custB__3213E83F4ACB1ECC]" IndexKind="Clustered" Storage="RowStore"></Object><SeekPredicates><SeekPredicateNew><SeekKeys><Prefix ScanType="EQ"><RangeColumns><ColumnReference Database="[fiddle_531ea60e05e6431181855e4c73be4716]" Schema="[dbo]" Table="[custB]" Column="id"></ColumnReference></RangeColumns><RangeExpressions><ScalarOperator ScalarString="(2)"><Const ConstValue="(2)"></Const></ScalarOperator></RangeExpressions></Prefix></SeekKeys></SeekPredicateNew></SeekPredicates></IndexScan></RelOp></ComputeScalar></RelOp></Concat></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>