clear markdown feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3799219 fiddles created (41737 in the last week).

create table #MyTable ( Col_A varchar(5), Col_B int ) insert into #MyTable values ('A',1) insert into #MyTable values ('A',1) insert into #MyTable values ('A',2) insert into #MyTable values ('A',2) insert into #MyTable values ('A',2) insert into #MyTable values ('A',3) insert into #MyTable values ('B',4) insert into #MyTable values ('B',4) insert into #MyTable values ('B',5)
9 rows affected
 hidden batch(es)


CREATE INDEX i ON #MyTable (Col_A, Col_B);
 hidden batch(es)


set statistics xml on; SELECT * FROM #MyTable AS mt CROSS APPLY ( SELECT COUNT(DISTINCT mt2.Col_B) AS dc FROM #MyTable AS mt2 WHERE mt2.Col_A = mt.Col_A -- GROUP BY mt2.Col_A ) AS ca;
Col_A Col_B dc
A 1 3
A 1 3
A 2 3
A 2 3
A 2 3
A 3 3
B 4 2
B 4 2
B 5 2
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 *&#xa;FROM #MyTable AS mt&#xa;CROSS APPLY ( SELECT COUNT(DISTINCT mt2.Col_B) AS dc&#xa; FROM #MyTable AS mt2&#xa; WHERE mt2.Col_A = mt.Col_A&#xa; -- GROUP BY mt2.Col_A &#xa; ) AS ca" StatementId="1" StatementCompId="2" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="0.00797214" StatementEstRows="9" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x76A40E7FE33C426B" QueryPlanHash="0x95D5E6BB777A4B52" 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="32" CompileTime="15" CompileCPU="15" CompileMemory="344"><MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="838808" EstimatedPagesCached="52425" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="904904"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2020-11-03T17:12:34.90" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000002_B5D7E539]" Table="[#MyTable____________________________________________________________________________________________________________0000000000BC]" Schema="[dbo]" Database="[tempdb]"></StatisticsInfo><StatisticsInfo LastUpdate="2020-11-03T17:12:34.89" ModificationCount="0" SamplingPercent="100" Statistics="[i]" Table="[#MyTable____________________________________________________________________________________________________________0000000000BC]" Schema="[dbo]" Database="[tempdb]"></StatisticsInfo></OptimizerStatsUsage><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="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="9" EstimateIO="0" EstimateCPU="9e-007" AvgRowSize="21" EstimatedTotalSubtreeCost="0.00797214" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_B"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1004"></ColumnReference><ScalarOperator ScalarString="CASE WHEN [Expr1004] IS NULL THEN (0) ELSE [Expr1004] END"><IF><Condition><ScalarOperator><Logical Operation="IS NULL"><ScalarOperator><Identifier><ColumnReference Column="Expr1004"></ColumnReference></Identifier></ScalarOperator></Logical></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Then><Else><ScalarOperator><Identifier><ColumnReference Column="Expr1004"></ColumnReference></Identifier></ScalarOperator></Else></IF></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Nested Loops" LogicalOp="Left Outer Join" EstimateRows="9" EstimateIO="0" EstimateCPU="3.762e-005" AvgRowSize="21" EstimatedTotalSubtreeCost="0.00797124" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_B"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="9" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><NestedLoops Optimized="0"><OuterReferences><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference></OuterReferences><RelOp NodeId="2" PhysicalOp="Index Scan" LogicalOp="Index Scan" EstimateRows="9" EstimatedRowsRead="9" EstimateIO="0.003125" EstimateCPU="0.0001669" AvgRowSize="17" EstimatedTotalSubtreeCost="0.0032919" TableCardinality="9" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_B"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="9" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="9" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_B"></ColumnReference></DefinedValue></DefinedValues><Object Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Index="[i]" Alias="[mt]" IndexKind="NonClustered" Storage="RowStore"></Object></IndexScan></RelOp><RelOp NodeId="3" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1" EstimateIO="0" EstimateCPU="0" AvgRowSize="11" EstimatedTotalSubtreeCost="0.00464172" Parallel="0" EstimateRebinds="4" EstimateRewinds="4" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1004"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1004"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1007],0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Identifier><ColumnReference Column="Expr1007"></ColumnReference></Identifier></ScalarOperator></Convert></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="4" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="1" EstimateIO="0" EstimateCPU="2.58594e-006" AvgRowSize="11" EstimatedTotalSubtreeCost="0.00464172" Parallel="0" EstimateRebinds="4" EstimateRewinds="4" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1007"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="9" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="0" ActualExecutions="9"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1007"></ColumnReference><ScalarOperator ScalarString="COUNT([tempdb].[dbo].[#MyTable].[Col_B] as [mt2].[Col_B])"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><Identifier><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="5" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="3.47656" EstimateIO="0" EstimateCPU="3.98828e-006" AvgRowSize="11" EstimatedTotalSubtreeCost="0.00461844" Parallel="0" EstimateRebinds="4" EstimateRewinds="4" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="24" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="9" ActualExecutions="9"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues></DefinedValues><GroupBy><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></GroupBy><RelOp NodeId="6" PhysicalOp="Index Seek" LogicalOp="Index Seek" EstimateRows="4.5" EstimatedRowsRead="4.5" EstimateIO="0.003125" EstimateCPU="0.00016195" AvgRowSize="11" EstimatedTotalSubtreeCost="0.00458255" TableCardinality="9" Parallel="0" EstimateRebinds="4" EstimateRewinds="4" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="45" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="9" ActualLogicalReads="18" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="45" ActualEndOfScans="9" ActualExecutions="9"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></DefinedValue></DefinedValues><Object Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Index="[i]" Alias="[mt2]" IndexKind="NonClustered" Storage="RowStore"></Object><SeekPredicates><SeekPredicateNew><SeekKeys><Prefix ScanType="EQ"><RangeColumns><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference></RangeColumns><RangeExpressions><ScalarOperator ScalarString="[tempdb].[dbo].[#MyTable].[Col_A] as [mt].[Col_A]"><Identifier><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference></Identifier></ScalarOperator></RangeExpressions></Prefix></SeekKeys></SeekPredicateNew></SeekPredicates></IndexScan></RelOp></StreamAggregate></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp></NestedLoops></RelOp></ComputeScalar></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
 hidden batch(es)


set statistics xml on; SELECT * FROM #MyTable AS mt CROSS APPLY ( SELECT COUNT(DISTINCT mt2.Col_B) AS dc FROM #MyTable AS mt2 WHERE mt2.Col_A = mt.Col_A GROUP BY mt2.Col_A ) AS ca;
Col_A Col_B dc
A 1 3
A 1 3
A 2 3
A 2 3
A 2 3
A 3 3
B 4 2
B 4 2
B 5 2
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 *&#xa;FROM #MyTable AS mt&#xa;CROSS APPLY ( SELECT COUNT(DISTINCT mt2.Col_B) AS dc&#xa; FROM #MyTable AS mt2&#xa; WHERE mt2.Col_A = mt.Col_A&#xa; GROUP BY mt2.Col_A &#xa; ) AS ca" StatementId="1" StatementCompId="2" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="0.00678942" StatementEstRows="9" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0xC6FF644F2AB61382" QueryPlanHash="0xEB6AA18104A755FE" 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="32" CompileTime="0" CompileCPU="0" CompileMemory="280"><MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="838808" EstimatedPagesCached="52425" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="904904"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2020-11-03T17:12:34.89" ModificationCount="0" SamplingPercent="100" Statistics="[i]" Table="[#MyTable____________________________________________________________________________________________________________0000000000BC]" Schema="[dbo]" Database="[tempdb]"></StatisticsInfo></OptimizerStatsUsage><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="Nested Loops" LogicalOp="Inner Join" EstimateRows="9" EstimateIO="0" EstimateCPU="3.762e-005" AvgRowSize="21" EstimatedTotalSubtreeCost="0.00678942" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_B"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="9" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><NestedLoops Optimized="0"><OuterReferences><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference></OuterReferences><RelOp NodeId="1" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="2" EstimateIO="0" EstimateCPU="0" AvgRowSize="16" EstimatedTotalSubtreeCost="0.0033029" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference><ColumnReference Column="Expr1004"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1004"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1007],0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Identifier><ColumnReference Column="Expr1007"></ColumnReference></Identifier></ScalarOperator></Convert></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="2" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="2" EstimateIO="0" EstimateCPU="4e-006" AvgRowSize="16" EstimatedTotalSubtreeCost="0.0033029" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference><ColumnReference Column="Expr1007"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="2" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1007"></ColumnReference><ScalarOperator ScalarString="COUNT([tempdb].[dbo].[#MyTable].[Col_B] as [mt2].[Col_B])"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><Identifier><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></Identifier></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference></GroupBy><RelOp NodeId="3" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="5" EstimateIO="0" EstimateCPU="7e-006" AvgRowSize="16" EstimatedTotalSubtreeCost="0.0032989" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="5" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues></DefinedValues><GroupBy><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></GroupBy><RelOp NodeId="4" PhysicalOp="Index Scan" LogicalOp="Index Scan" EstimateRows="9" EstimatedRowsRead="9" EstimateIO="0.003125" EstimateCPU="0.0001669" AvgRowSize="16" EstimatedTotalSubtreeCost="0.0032919" TableCardinality="9" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="9" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="9" 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="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_B"></ColumnReference></DefinedValue></DefinedValues><Object Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Index="[i]" Alias="[mt2]" IndexKind="NonClustered" Storage="RowStore"></Object></IndexScan></RelOp></StreamAggregate></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp><RelOp NodeId="5" PhysicalOp="Index Seek" LogicalOp="Index Seek" EstimateRows="4.5" EstimatedRowsRead="4.5" EstimateIO="0.003125" EstimateCPU="0.00016195" AvgRowSize="17" EstimatedTotalSubtreeCost="0.0034489" TableCardinality="9" Parallel="0" EstimateRebinds="1" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_B"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="9" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="2" ActualLogicalReads="4" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="9" ActualEndOfScans="2" ActualExecutions="2"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_B"></ColumnReference></DefinedValue></DefinedValues><Object Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Index="[i]" Alias="[mt]" IndexKind="NonClustered" Storage="RowStore"></Object><SeekPredicates><SeekPredicateNew><SeekKeys><Prefix ScanType="EQ"><RangeColumns><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt]" Column="Col_A"></ColumnReference></RangeColumns><RangeExpressions><ScalarOperator ScalarString="[tempdb].[dbo].[#MyTable].[Col_A] as [mt2].[Col_A]"><Identifier><ColumnReference Database="[tempdb]" Schema="[dbo]" Table="[#MyTable]" Alias="[mt2]" Column="Col_A"></ColumnReference></Identifier></ScalarOperator></RangeExpressions></Prefix></SeekKeys></SeekPredicateNew></SeekPredicates></IndexScan></RelOp></NestedLoops></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
 hidden batch(es)