add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
173 rows affected
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.564" Build="16.0.1000.6"><BatchSequence><Batch><Statements><StmtSimple StatementText="INSERT INTO @Target (ExamObjID, Locus, Value)&#xa;SELECT ExamObjID, Locus, Value&#xa;FROM vwValues&#xa;WHERE ExamObjID = @ExamObjID" StatementId="1" StatementCompId="3" StatementType="INSERT" StatementSqlHandle="0x0900CD99B56008FF76FB96CA73B8D72D14C90000000000000000000000000000000000000000000000000000" DatabaseContextSettingsId="3" ParentObjectId="0" BatchSqlHandle="0x02000000D79786123E747C100BE1F85F56113ABE176097EB0000000000000000000000000000000000000000" StatementParameterizationType="0" RetrievedFromCache="false" StatementSubTreeCost="0.0176" StatementEstRows="14" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x8A20180340ADFC1B" QueryPlanHash="0x5D3009277E2E496E" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="160"><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="TableVariableTransactionsDoNotSupportParallelNestedTransaction" CachedPlanSize="24" CompileTime="15" CompileCPU="15" CompileMemory="272"><MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" GrantedMemory="0" MaxUsedMemory="0"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="1258238" EstimatedPagesCached="78639" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1013776"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2023-04-12T06:43:06.19" ModificationCount="0" SamplingPercent="100" Statistics="[PK__ExamObje__80BD4EBD612BA103]" Table="[ExamObjects]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></StatisticsInfo><StatisticsInfo LastUpdate="2023-04-12T06:43:06.19" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000002_37A5467C]" Table="[DNAValues]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></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="Clustered Index Insert" LogicalOp="Insert" EstimateRows="14" EstimateIO="0.01" EstimateCPU="1.4e-05" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0176" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="14" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="29" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Update DMLRequestSort="0"><Object Table="[@Target]" Index="[PK__#BF0A46D__C41ED54102C84E6F]" Storage="RowStore"></Object><SetPredicate><ScalarOperator ScalarString="[ExamObjID] = [fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[ExamObjects].[ExamObjID],[Locus] = [fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[Locus],[Value] = RaiseIfNullInsert([fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[Value])"><ScalarExpressionList><ScalarOperator><MultipleAssign><Assign><ColumnReference Column="ExamObjID"></ColumnReference><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator></Assign><Assign><ColumnReference Column="Locus"></ColumnReference><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></Identifier></ScalarOperator></Assign><Assign><ColumnReference Column="Value"></ColumnReference><ScalarOperator><Intrinsic FunctionName="RaiseIfNullInsert"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></Identifier></ScalarOperator></Intrinsic></ScalarOperator></Assign></MultipleAssign></ScalarOperator></ScalarExpressionList></ScalarOperator></SetPredicate><RelOp NodeId="1" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="14" EstimateIO="0" EstimateCPU="5.852e-05" AvgRowSize="38" EstimatedTotalSubtreeCost="0.00758604" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="14" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><NestedLoops Optimized="0"><RelOp NodeId="2" PhysicalOp="Clustered Index Seek" LogicalOp="Clustered Index Seek" EstimateRows="1" EstimatedRowsRead="1" EstimateIO="0.003125" EstimateCPU="0.0001581" AvgRowSize="24" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="10" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="1" ScanDirection="FORWARD" ForcedIndex="0" ForceSeek="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Index="[PK__ExamObje__80BD4EBD612BA103]" IndexKind="Clustered" Storage="RowStore"></Object><SeekPredicates><SeekPredicateNew><SeekKeys><Prefix ScanType="EQ"><RangeColumns><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></RangeColumns><RangeExpressions><ScalarOperator ScalarString="[@ExamObjID]"><Identifier><ColumnReference Column="@ExamObjID"></ColumnReference></Identifier></ScalarOperator></RangeExpressions></Prefix></SeekKeys></SeekPredicateNew></SeekPredicates><Predicate><ScalarOperator ScalarString="[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[ExamObjects].[ValidateState]=&apos;A&apos;"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ValidateState"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="&apos;A&apos;"></Const></ScalarOperator></Compare></ScalarOperator></Predicate></IndexScan></RelOp><RelOp NodeId="3" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="14" EstimatedRowsRead="140" EstimateIO="0.00386574" EstimateCPU="0.000311" AvgRowSize="38" EstimatedTotalSubtreeCost="0.00417674" TableCardinality="140" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="14" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="4" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="140" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Index="[PK__DNAValue__514EA7271116A4C0]" IndexKind="Clustered" Storage="RowStore"></Object><Predicate><ScalarOperator ScalarString="[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[ExamObjID]=[@ExamObjID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Column="@ExamObjID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></Predicate></IndexScan></RelOp></NestedLoops></RelOp></Update></RelOp><ParameterList><ColumnReference Column="@ExamObjID" ParameterDataType="uniqueidentifier" ParameterRuntimeValue="{guid&apos;62DA5C53-E70A-473A-923B-388232B79AFF&apos;}"></ColumnReference></ParameterList></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
ExamObjID Locus Matches
59de806a-a675-4120-b1e4-68f41804defd L1T1234 1
6ad47977-3722-4693-81b2-747bb6a42b0b L1T1234 2
ba365217-bbce-4160-b891-82408e1ad498 L1T1234 1
183bfe2a-1469-411e-a0cd-82de301917a5 L1T1234 2
70a15724-a515-463c-915f-94260ad2cc64 L1T1234 2
45864697-4e0a-49cd-90be-9dba56a0bd29 L1T1234 2
fe36745d-5e2f-40e0-921a-c441f2102662 L1T1234 2
8dc9f4b1-34c7-4a81-abb1-f11bb6779278 L1T1234 2
9c2aeeb1-f651-4740-8b3e-f42ac01e089a L1T1234 1
59de806a-a675-4120-b1e4-68f41804defd L2T54332 2
6ad47977-3722-4693-81b2-747bb6a42b0b L2T54332 2
ba365217-bbce-4160-b891-82408e1ad498 L2T54332 1
183bfe2a-1469-411e-a0cd-82de301917a5 L2T54332 1
70a15724-a515-463c-915f-94260ad2cc64 L2T54332 2
45864697-4e0a-49cd-90be-9dba56a0bd29 L2T54332 2
fe36745d-5e2f-40e0-921a-c441f2102662 L2T54332 2
8dc9f4b1-34c7-4a81-abb1-f11bb6779278 L2T54332 2
9c2aeeb1-f651-4740-8b3e-f42ac01e089a L2T54332 2
59de806a-a675-4120-b1e4-68f41804defd L4R4 2
6ad47977-3722-4693-81b2-747bb6a42b0b L4R4 2
ba365217-bbce-4160-b891-82408e1ad498 L4R4 2
183bfe2a-1469-411e-a0cd-82de301917a5 L4R4 2
70a15724-a515-463c-915f-94260ad2cc64 L4R4 2
45864697-4e0a-49cd-90be-9dba56a0bd29 L4R4 2
fe36745d-5e2f-40e0-921a-c441f2102662 L4R4 1
8dc9f4b1-34c7-4a81-abb1-f11bb6779278 L4R4 2
9c2aeeb1-f651-4740-8b3e-f42ac01e089a L4R4 2
59de806a-a675-4120-b1e4-68f41804defd L5RTdev 2
6ad47977-3722-4693-81b2-747bb6a42b0b L5RTdev 2
ba365217-bbce-4160-b891-82408e1ad498 L5RTdev 2
183bfe2a-1469-411e-a0cd-82de301917a5 L5RTdev 1
70a15724-a515-463c-915f-94260ad2cc64 L5RTdev 2
45864697-4e0a-49cd-90be-9dba56a0bd29 L5RTdev 1
fe36745d-5e2f-40e0-921a-c441f2102662 L5RTdev 2
8dc9f4b1-34c7-4a81-abb1-f11bb6779278 L5RTdev 2
9c2aeeb1-f651-4740-8b3e-f42ac01e089a L5RTdev 1
59de806a-a675-4120-b1e4-68f41804defd L6T10 2
6ad47977-3722-4693-81b2-747bb6a42b0b L6T10 2
ba365217-bbce-4160-b891-82408e1ad498 L6T10 2
183bfe2a-1469-411e-a0cd-82de301917a5 L6T10 2
70a15724-a515-463c-915f-94260ad2cc64 L6T10 2
45864697-4e0a-49cd-90be-9dba56a0bd29 L6T10 2
fe36745d-5e2f-40e0-921a-c441f2102662 L6T10 2
8dc9f4b1-34c7-4a81-abb1-f11bb6779278 L6T10 2
9c2aeeb1-f651-4740-8b3e-f42ac01e089a L6T10 2
59de806a-a675-4120-b1e4-68f41804defd L7indel 2
6ad47977-3722-4693-81b2-747bb6a42b0b L7indel 2
ba365217-bbce-4160-b891-82408e1ad498 L7indel 2
183bfe2a-1469-411e-a0cd-82de301917a5 L7indel 2
70a15724-a515-463c-915f-94260ad2cc64 L7indel 2
45864697-4e0a-49cd-90be-9dba56a0bd29 L7indel 2
fe36745d-5e2f-40e0-921a-c441f2102662 L7indel 2
8dc9f4b1-34c7-4a81-abb1-f11bb6779278 L7indel 2
9c2aeeb1-f651-4740-8b3e-f42ac01e089a L7indel 2
59de806a-a675-4120-b1e4-68f41804defd L8cascade 2
6ad47977-3722-4693-81b2-747bb6a42b0b L8cascade 2
ba365217-bbce-4160-b891-82408e1ad498 L8cascade 2
183bfe2a-1469-411e-a0cd-82de301917a5 L8cascade 2
70a15724-a515-463c-915f-94260ad2cc64 L8cascade 2
45864697-4e0a-49cd-90be-9dba56a0bd29 L8cascade 2
fe36745d-5e2f-40e0-921a-c441f2102662 L8cascade 2
8dc9f4b1-34c7-4a81-abb1-f11bb6779278 L8cascade 2
9c2aeeb1-f651-4740-8b3e-f42ac01e089a L8cascade 2
Warning: Null value is eliminated by an aggregate or other SET operation.

Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.564" Build="16.0.1000.6"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT&#xa; other.ExamObjID,&#xa; other.Locus,&#xa; Matches = COUNT(CASE WHEN other.Value = t.Value THEN 1 END)&#xa; FROM vwValues other&#xa; JOIN @Target t ON t.Locus = other.Locus&#xa; WHERE t.ExamObjID &lt;&gt; other.ExamObjID&#xa; GROUP BY&#xa; other.ExamObjID,&#xa; other.Locus" StatementId="2" StatementCompId="4" StatementType="SELECT" StatementSqlHandle="0x0900C78D13E506DD8B167A1BB6BFCF6DFF2A0000000000000000000000000000000000000000000000000000" DatabaseContextSettingsId="3" ParentObjectId="0" BatchSqlHandle="0x02000000D79786123E747C100BE1F85F56113ABE176097EB0000000000000000000000000000000000000000" StatementParameterizationType="0" RetrievedFromCache="false" StatementSubTreeCost="0.0622807" StatementEstRows="62.8014" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0xD56CE06D39557E89" QueryPlanHash="0x01A7B4283AC07333" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="160"><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" MemoryGrant="2656" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="88" CompileTime="0" CompileCPU="0" CompileMemory="400"><MemoryGrantInfo SerialRequiredMemory="2560" SerialDesiredMemory="2656" RequiredMemory="2560" DesiredMemory="2656" RequestedMemory="2656" GrantWaitTime="0" MaxQueryMemory="727192" GrantedMemory="2656" MaxUsedMemory="592"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="1258238" EstimatedPagesCached="78639" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1013776"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2023-04-12T06:43:06.19" ModificationCount="0" SamplingPercent="100" Statistics="[PK__ExamObje__80BD4EBD612BA103]" Table="[ExamObjects]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></StatisticsInfo><StatisticsInfo LastUpdate="2023-04-12T06:43:06.22" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000006_35BCFE0A]" Table="[ExamObjects]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></StatisticsInfo><StatisticsInfo LastUpdate="2023-04-12T06:43:06.19" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000002_37A5467C]" Table="[DNAValues]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></StatisticsInfo><StatisticsInfo LastUpdate="2023-04-12T06:43:06.19" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000003_37A5467C]" Table="[DNAValues]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></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="62.8014" EstimateIO="0" EstimateCPU="0" AvgRowSize="37" EstimatedTotalSubtreeCost="0.0622807" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Column="Expr1005"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1005"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1006],0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Identifier><ColumnReference Column="Expr1006"></ColumnReference></Identifier></ScalarOperator></Convert></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="62.8014" EstimateIO="0" EstimateCPU="0.000115401" AvgRowSize="37" EstimatedTotalSubtreeCost="0.0622807" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Column="Expr1006"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="63" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1006"></ColumnReference><ScalarOperator ScalarString="COUNT(CASE WHEN [fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[Value]=@Target.[Value] as [t].[Value] THEN (1) ELSE NULL END)"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="(1)"></Const></ScalarOperator></Then><Else><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Else></IF></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></GroupBy><RelOp NodeId="2" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="140" EstimateIO="0.0112613" EstimateCPU="0.00165708" AvgRowSize="41" EstimatedTotalSubtreeCost="0.0621653" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></OutputList><MemoryFractions Input="0.333333" Output="1"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="252" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRebinds="1" ActualRewinds="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="544" OutputMemoryGrant="224" UsedMemoryGrant="32" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></OrderByColumn><OrderByColumn Ascending="1"><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></OrderByColumn></OrderBy><RelOp NodeId="3" PhysicalOp="Hash Match" LogicalOp="Inner Join" EstimateRows="140" EstimateIO="0" EstimateCPU="0.019427" AvgRowSize="41" EstimatedTotalSubtreeCost="0.049247" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></OutputList><MemoryFractions Input="0.5" Output="0.333333"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="252" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1072" OutputMemoryGrant="1056" UsedMemoryGrant="248" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Hash><DefinedValues></DefinedValues><HashKeysBuild><ColumnReference Table="@Target" Alias="[t]" Column="Locus"></ColumnReference></HashKeysBuild><HashKeysProbe><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></HashKeysProbe><ProbeResidual><ScalarOperator ScalarString="[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[Locus]=@Target.[Locus] as [t].[Locus] AND @Target.[ExamObjID] as [t].[ExamObjID]&lt;&gt;[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[ExamObjects].[ExamObjID]"><Logical Operation="AND"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Table="@Target" Alias="[t]" Column="Locus"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="NE"><ScalarOperator><Identifier><ColumnReference Table="@Target" Alias="[t]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></ProbeResidual><RelOp NodeId="4" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="14" EstimatedRowsRead="14" EstimateIO="0.003125" EstimateCPU="0.0001724" AvgRowSize="38" EstimatedTotalSubtreeCost="0.0032974" TableCardinality="14" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Table="@Target" Alias="[t]" Column="ExamObjID"></ColumnReference><ColumnReference Table="@Target" Alias="[t]" Column="Locus"></ColumnReference><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="14" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="14" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Table="@Target" Alias="[t]" Column="ExamObjID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Table="@Target" Alias="[t]" Column="Locus"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></DefinedValue></DefinedValues><Object Table="[@Target]" Index="[PK__#BF0A46D__C41ED54102C84E6F]" Alias="[t]" Storage="RowStore"></Object></IndexScan></RelOp><RelOp NodeId="5" PhysicalOp="Hash Match" LogicalOp="Inner Join" EstimateRows="140" EstimateIO="0" EstimateCPU="0.0190381" AvgRowSize="37" EstimatedTotalSubtreeCost="0.0265156" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></OutputList><MemoryFractions Input="0.5" Output="0.333333"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="140" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1072" OutputMemoryGrant="1056" UsedMemoryGrant="320" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Hash><DefinedValues></DefinedValues><HashKeysBuild><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></HashKeysBuild><HashKeysProbe><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference></HashKeysProbe><ProbeResidual><ScalarOperator ScalarString="[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[ExamObjID]=[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[ExamObjects].[ExamObjID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></ProbeResidual><RelOp NodeId="6" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="10" EstimatedRowsRead="10" EstimateIO="0.003125" EstimateCPU="0.000168" AvgRowSize="24" EstimatedTotalSubtreeCost="0.003293" TableCardinality="10" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="10" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="10" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Index="[PK__ExamObje__80BD4EBD612BA103]" IndexKind="Clustered" Storage="RowStore"></Object><Predicate><ScalarOperator ScalarString="[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[ExamObjects].[ValidateState]=&apos;A&apos;"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ValidateState"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="&apos;A&apos;"></Const></ScalarOperator></Compare></ScalarOperator></Predicate></IndexScan></RelOp><RelOp NodeId="7" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="140" EstimatedRowsRead="140" EstimateIO="0.00386574" EstimateCPU="0.000311" AvgRowSize="37" EstimatedTotalSubtreeCost="0.00417674" TableCardinality="140" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="140" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="4" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="140" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Index="[PK__DNAValue__514EA7271116A4C0]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp></Hash></RelOp></Hash></RelOp></Sort></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
ExamObjID Mismatches
59de806a-a675-4120-b1e4-68f41804defd 0
6ad47977-3722-4693-81b2-747bb6a42b0b 0
ba365217-bbce-4160-b891-82408e1ad498 0
183bfe2a-1469-411e-a0cd-82de301917a5 0
70a15724-a515-463c-915f-94260ad2cc64 0
45864697-4e0a-49cd-90be-9dba56a0bd29 0
fe36745d-5e2f-40e0-921a-c441f2102662 0
8dc9f4b1-34c7-4a81-abb1-f11bb6779278 0
9c2aeeb1-f651-4740-8b3e-f42ac01e089a 0
Warning: Null value is eliminated by an aggregate or other SET operation.

Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.564" Build="16.0.1000.6"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT&#xa; other.ExamObjID,&#xa; Mismatches = COUNT(CASE WHEN other.Matches = 0 THEN 1 END)&#xa;FROM (&#xa; SELECT&#xa; other.ExamObjID,&#xa; other.Locus,&#xa; Matches = COUNT(CASE WHEN other.Value = t.Value THEN 1 END)&#xa; FROM vwValues other&#xa; JOIN @Target t ON t.Locus = other.Locus&#xa; WHERE t.ExamObjID &lt;&gt; other.ExamObjID&#xa; GROUP BY&#xa; other.ExamObjID,&#xa; other.Locus&#xa;) other&#xa;GROUP BY&#xa; other.ExamObjID&#xa;HAVING COUNT(*) &gt;= 6&#xa; AND COUNT(CASE WHEN other.Matches = 0 THEN 1 END) &lt;= 2" StatementId="3" StatementCompId="5" StatementType="SELECT" StatementSqlHandle="0x0900C699AFB5EC153842F80F92C405240EEC0000000000000000000000000000000000000000000000000000" DatabaseContextSettingsId="3" ParentObjectId="0" BatchSqlHandle="0x02000000D79786123E747C100BE1F85F56113ABE176097EB0000000000000000000000000000000000000000" StatementParameterizationType="0" RetrievedFromCache="false" StatementSubTreeCost="0.0623322" StatementEstRows="1" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0xF2CD158255C93099" QueryPlanHash="0x081D988C01B0FAC7" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="160"><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" MemoryGrant="2656" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="96" CompileTime="15" CompileCPU="15" CompileMemory="504"><MemoryGrantInfo SerialRequiredMemory="2560" SerialDesiredMemory="2656" RequiredMemory="2560" DesiredMemory="2656" RequestedMemory="2656" GrantWaitTime="0" MaxQueryMemory="727192" GrantedMemory="2656" MaxUsedMemory="592"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="1258238" EstimatedPagesCached="78639" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1013776"></OptimizerHardwareDependentProperties><OptimizerStatsUsage><StatisticsInfo LastUpdate="2023-04-12T06:43:06.19" ModificationCount="0" SamplingPercent="100" Statistics="[PK__ExamObje__80BD4EBD612BA103]" Table="[ExamObjects]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></StatisticsInfo><StatisticsInfo LastUpdate="2023-04-12T06:43:06.22" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000006_35BCFE0A]" Table="[ExamObjects]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></StatisticsInfo><StatisticsInfo LastUpdate="2023-04-12T06:43:06.19" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000002_37A5467C]" Table="[DNAValues]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></StatisticsInfo><StatisticsInfo LastUpdate="2023-04-12T06:43:06.19" ModificationCount="0" SamplingPercent="100" Statistics="[_WA_Sys_00000003_37A5467C]" Table="[DNAValues]" Schema="[dbo]" Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]"></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="Filter" LogicalOp="Filter" EstimateRows="1" EstimateIO="0" EstimateCPU="8.8e-06" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0623322" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Column="Expr1007"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="9" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Filter StartupExpression="0"><RelOp NodeId="1" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="10" EstimateIO="0" EstimateCPU="0" AvgRowSize="31" EstimatedTotalSubtreeCost="0.0623234" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Column="Expr1006"></ColumnReference><ColumnReference Column="Expr1007"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1006"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1009],0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Identifier><ColumnReference Column="Expr1009"></ColumnReference></Identifier></ScalarOperator></Convert></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1007"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1010],0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Identifier><ColumnReference Column="Expr1010"></ColumnReference></Identifier></ScalarOperator></Convert></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="2" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="10" EstimateIO="0" EstimateCPU="4.26808e-05" AvgRowSize="31" EstimatedTotalSubtreeCost="0.0623234" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Column="Expr1009"></ColumnReference><ColumnReference Column="Expr1010"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="9" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1009"></ColumnReference><ScalarOperator ScalarString="Count(*)"><Aggregate AggType="countstar" Distinct="0"></Aggregate></ScalarOperator></DefinedValue><DefinedValue><ColumnReference Column="Expr1010"></ColumnReference><ScalarOperator ScalarString="COUNT(CASE WHEN [Expr1005]=(0) THEN (1) ELSE NULL END)"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1005"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="(1)"></Const></ScalarOperator></Then><Else><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Else></IF></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></GroupBy><RelOp NodeId="3" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="62.8014" EstimateIO="0" EstimateCPU="0" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0622807" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Column="Expr1005"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1005"></ColumnReference><ScalarOperator ScalarString="CONVERT_IMPLICIT(int,[Expr1008],0)"><Convert DataType="int" Style="0" Implicit="1"><ScalarOperator><Identifier><ColumnReference Column="Expr1008"></ColumnReference></Identifier></ScalarOperator></Convert></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="4" PhysicalOp="Stream Aggregate" LogicalOp="Aggregate" EstimateRows="62.8014" EstimateIO="0" EstimateCPU="0.000115401" AvgRowSize="27" EstimatedTotalSubtreeCost="0.0622807" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Column="Expr1008"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="63" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><StreamAggregate><DefinedValues><DefinedValue><ColumnReference Column="Expr1008"></ColumnReference><ScalarOperator ScalarString="COUNT(CASE WHEN [fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[Value]=@Target.[Value] as [t].[Value] THEN (1) ELSE NULL END)"><Aggregate Distinct="0" AggType="COUNT_BIG"><ScalarOperator><IF><Condition><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></Condition><Then><ScalarOperator><Const ConstValue="(1)"></Const></ScalarOperator></Then><Else><ScalarOperator><Const ConstValue="NULL"></Const></ScalarOperator></Else></IF></ScalarOperator></Aggregate></ScalarOperator></DefinedValue></DefinedValues><GroupBy><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></GroupBy><RelOp NodeId="5" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="140" EstimateIO="0.0112613" EstimateCPU="0.00165708" AvgRowSize="41" EstimatedTotalSubtreeCost="0.0621653" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></OutputList><MemoryFractions Input="0.333333" Output="1"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="252" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRebinds="1" ActualRewinds="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="544" OutputMemoryGrant="224" UsedMemoryGrant="32" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></OrderByColumn><OrderByColumn Ascending="1"><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></OrderByColumn></OrderBy><RelOp NodeId="6" PhysicalOp="Hash Match" LogicalOp="Inner Join" EstimateRows="140" EstimateIO="0" EstimateCPU="0.019427" AvgRowSize="41" EstimatedTotalSubtreeCost="0.049247" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></OutputList><MemoryFractions Input="0.5" Output="0.333333"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="252" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1072" OutputMemoryGrant="1056" UsedMemoryGrant="248" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Hash><DefinedValues></DefinedValues><HashKeysBuild><ColumnReference Table="@Target" Alias="[t]" Column="Locus"></ColumnReference></HashKeysBuild><HashKeysProbe><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></HashKeysProbe><ProbeResidual><ScalarOperator ScalarString="[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[Locus]=@Target.[Locus] as [t].[Locus] AND @Target.[ExamObjID] as [t].[ExamObjID]&lt;&gt;[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[ExamObjects].[ExamObjID]"><Logical Operation="AND"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Table="@Target" Alias="[t]" Column="Locus"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="NE"><ScalarOperator><Identifier><ColumnReference Table="@Target" Alias="[t]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></ProbeResidual><RelOp NodeId="7" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="14" EstimatedRowsRead="14" EstimateIO="0.003125" EstimateCPU="0.0001724" AvgRowSize="38" EstimatedTotalSubtreeCost="0.0032974" TableCardinality="14" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Table="@Target" Alias="[t]" Column="ExamObjID"></ColumnReference><ColumnReference Table="@Target" Alias="[t]" Column="Locus"></ColumnReference><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="14" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="14" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Table="@Target" Alias="[t]" Column="ExamObjID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Table="@Target" Alias="[t]" Column="Locus"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Table="@Target" Alias="[t]" Column="Value"></ColumnReference></DefinedValue></DefinedValues><Object Table="[@Target]" Index="[PK__#BF0A46D__C41ED54102C84E6F]" Alias="[t]" Storage="RowStore"></Object></IndexScan></RelOp><RelOp NodeId="8" PhysicalOp="Hash Match" LogicalOp="Inner Join" EstimateRows="140" EstimateIO="0" EstimateCPU="0.0190381" AvgRowSize="37" EstimatedTotalSubtreeCost="0.0265156" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></OutputList><MemoryFractions Input="0.5" Output="0.333333"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="140" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1072" OutputMemoryGrant="1056" UsedMemoryGrant="320" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><Hash><DefinedValues></DefinedValues><HashKeysBuild><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></HashKeysBuild><HashKeysProbe><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference></HashKeysProbe><ProbeResidual><ScalarOperator ScalarString="[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[DNAValues].[ExamObjID]=[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[ExamObjects].[ExamObjID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></ProbeResidual><RelOp NodeId="9" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="10" EstimatedRowsRead="10" EstimateIO="0.003125" EstimateCPU="0.000168" AvgRowSize="24" EstimatedTotalSubtreeCost="0.003293" TableCardinality="10" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="10" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="10" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ExamObjID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Index="[PK__ExamObje__80BD4EBD612BA103]" IndexKind="Clustered" Storage="RowStore"></Object><Predicate><ScalarOperator ScalarString="[fiddle_c5d4a5d246684819ba5ccf1043a07525].[dbo].[ExamObjects].[ValidateState]=&apos;A&apos;"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[ExamObjects]" Column="ValidateState"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="&apos;A&apos;"></Const></ScalarOperator></Compare></ScalarOperator></Predicate></IndexScan></RelOp><RelOp NodeId="10" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="140" EstimatedRowsRead="140" EstimateIO="0.00386574" EstimateCPU="0.000311" AvgRowSize="37" EstimatedTotalSubtreeCost="0.00417674" TableCardinality="140" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="140" Batches="0" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="4" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="140" ActualEndOfScans="1" ActualExecutions="1" ActualExecutionMode="Row"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="ExamObjID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Locus"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Column="Value"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_c5d4a5d246684819ba5ccf1043a07525]" Schema="[dbo]" Table="[DNAValues]" Index="[PK__DNAValue__514EA7271116A4C0]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp></Hash></RelOp></Hash></RelOp></Sort></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp></StreamAggregate></RelOp></ComputeScalar></RelOp><Predicate><ScalarOperator ScalarString="[Expr1006]&gt;=(6) AND [Expr1007]&lt;=(2)"><Logical Operation="AND"><ScalarOperator><Compare CompareOp="GE"><ScalarOperator><Identifier><ColumnReference Column="Expr1006"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(6)"></Const></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="LE"><ScalarOperator><Identifier><ColumnReference Column="Expr1007"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(2)"></Const></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></Predicate></Filter></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>