clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1044295 fiddles created (9409 in the last week).

CREATE TABLE dbo.BASE_TABLE (ID BIGINT NOT NULL, PRIMARY KEY (ID)); INSERT INTO dbo.BASE_TABLE WITH (TABLOCK) SELECT TOP (1000) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) FROM master..spt_values; CREATE TABLE dbo.COL1_TABLE (ID BIGINT NOT NULL, COL1 VARCHAR(1), PRIMARY KEY (ID)); INSERT INTO dbo.COL1_TABLE WITH (TABLOCK) SELECT TOP (1000) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)), 'A' FROM master..spt_values; CREATE TABLE dbo.COL2_TABLE (ID BIGINT NOT NULL, COL2 VARCHAR(1), PRIMARY KEY (ID)); INSERT INTO dbo.COL2_TABLE WITH (TABLOCK) SELECT TOP (1000) ROW_NUMBER() OVER (ORDER BY (SELECT NULL)), 'A' FROM master..spt_values;
3000 rows affected
 hidden batch(es)


CREATE VIEW HugeView AS SELECT b.ID AS B_ID, c1.COL1, c2.COL2 FROM dbo.BASE_TABLE b LEFT OUTER JOIN dbo.COL1_TABLE c1 ON b.ID = c1.ID LEFT OUTER JOIN dbo.COL2_TABLE c2 ON b.ID = c2.ID;
 hidden batch(es)


set statistics xml on; DECLARE @Val BIGINT = 1; SELECT 1 FROM dbo.HugeView WHERE (Col1 = 'A' AND @val = 1) OR (Col2 = 'A' AND @Val = 0);
(No column name)
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.5" Build="13.0.4001.0"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT 1 FROM dbo.HugeView&#xa;WHERE (Col1 = &apos;A&apos; AND @val = 1) OR (Col2 = &apos;A&apos; AND @Val = 0)" StatementId="1" StatementCompId="3" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="0.105613" StatementEstRows="451.581" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x54F3767E5C9DD8B9" QueryPlanHash="0x28A0A6B355665DC7" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="130"><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="2720" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="72" CompileTime="0" CompileCPU="0" CompileMemory="424"><MemoryGrantInfo SerialRequiredMemory="2048" SerialDesiredMemory="2720" RequiredMemory="2048" DesiredMemory="2720" RequestedMemory="2720" GrantWaitTime="0" GrantedMemory="2720" MaxUsedMemory="1280" MaxQueryMemory="624408"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="419378" EstimatedPagesCached="26211" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1567984"></OptimizerHardwareDependentProperties><TraceFlags IsCompileTime="1"><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><QueryTimeStats ElapsedTime="0" CpuTime="0"></QueryTimeStats><RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="451.581" EstimateIO="0" EstimateCPU="4.51581e-005" AvgRowSize="11" EstimatedTotalSubtreeCost="0.105613" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1003"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1003"></ColumnReference><ScalarOperator ScalarString="(1)"><Const ConstValue="(1)"></Const></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="451.581" EstimateIO="0" EstimateCPU="0.00128" AvgRowSize="9" EstimatedTotalSubtreeCost="0.105567" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Filter StartupExpression="0"><RelOp NodeId="2" PhysicalOp="Hash Match" LogicalOp="Right Outer Join" EstimateRows="1000" EstimateIO="0" EstimateCPU="0.04468" AvgRowSize="15" EstimatedTotalSubtreeCost="0.104287" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="COL1"></ColumnReference><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="COL2"></ColumnReference></OutputList><MemoryFractions Input="0.52381" Output="0.52381"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1376" OutputMemoryGrant="1376" UsedMemoryGrant="640"></RunTimeCountersPerThread></RunTimeInformation><Hash><DefinedValues></DefinedValues><HashKeysBuild><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="ID"></ColumnReference></HashKeysBuild><HashKeysProbe><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></HashKeysProbe><ProbeResidual><ScalarOperator ScalarString="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[BASE_TABLE].[ID] as [b].[ID]=[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL2_TABLE].[ID] as [c2].[ID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="ID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></ProbeResidual><RelOp NodeId="3" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="20" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="ID"></ColumnReference><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="COL2"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="5" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1000" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="ID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="COL2"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Index="[PK__COL2_TAB__3214EC2772ED9C8B]" Alias="[c2]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp><RelOp NodeId="4" PhysicalOp="Hash Match" LogicalOp="Left Outer Join" EstimateRows="1000" EstimateIO="0" EstimateCPU="0.0420109" AvgRowSize="20" EstimatedTotalSubtreeCost="0.0537409" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="COL1"></ColumnReference></OutputList><MemoryFractions Input="0.47619" Output="0.47619"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1344" OutputMemoryGrant="1344" UsedMemoryGrant="640"></RunTimeCountersPerThread></RunTimeInformation><Hash><DefinedValues></DefinedValues><HashKeysBuild><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></HashKeysBuild><HashKeysProbe><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></HashKeysProbe><ProbeResidual><ScalarOperator ScalarString="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[BASE_TABLE].[ID] as [b].[ID]=[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL1_TABLE].[ID] as [c1].[ID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></ProbeResidual><RelOp NodeId="5" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="15" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="5" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1000" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Index="[PK__BASE_TAB__3214EC27704D9951]" Alias="[b]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp><RelOp NodeId="6" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="20" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="COL1"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="5" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1000" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></DefinedValue><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="COL1"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Index="[PK__COL1_TAB__3214EC270A5ED91A]" Alias="[c1]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp></Hash></RelOp></Hash></RelOp><Predicate><ScalarOperator ScalarString="[@Val]=(1) AND [fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL1_TABLE].[COL1] as [c1].[COL1]=&apos;A&apos; OR [@Val]=(0) AND [fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL2_TABLE].[COL2] as [c2].[COL2]=&apos;A&apos;"><Logical Operation="OR"><ScalarOperator><Logical Operation="AND"><ScalarOperator><Identifier><ColumnReference Column="ConstExpr1004"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="@Val"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(1)"></Const></ScalarOperator></Compare></ScalarOperator></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="COL1"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="&apos;A&apos;"></Const></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator><ScalarOperator><Logical Operation="AND"><ScalarOperator><Identifier><ColumnReference Column="ConstExpr1005"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="@Val"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="COL2"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="&apos;A&apos;"></Const></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></Logical></ScalarOperator></Predicate></Filter></RelOp></ComputeScalar></RelOp><ParameterList><ColumnReference Column="@Val" ParameterDataType="bigint" ParameterRuntimeValue="(1)"></ColumnReference></ParameterList></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
 hidden batch(es)


set statistics xml on; DECLARE @Val BIGINT = 1; SELECT 1 FROM dbo.HugeView WHERE (Col1 = 'A' AND @val = 1) OR (Col2 = 'A' AND @Val = 0) OPTION (RECOMPILE);
(No column name)
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.5" Build="13.0.4001.0"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT 1 FROM dbo.HugeView&#xa;WHERE (Col1 = &apos;A&apos; AND @val = 1) OR (Col2 = &apos;A&apos; AND @Val = 0)&#xa;OPTION (RECOMPILE)" StatementId="1" StatementCompId="3" StatementType="SELECT" RetrievedFromCache="false" StatementSubTreeCost="0.02221" StatementEstRows="1000" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0xD00AC35F1A53B957" QueryPlanHash="0x99F1F5F8F7CDF7A" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="130"><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="0" CompileCPU="0" CompileMemory="336"><MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="419378" EstimatedPagesCached="26211" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1567984"></OptimizerHardwareDependentProperties><TraceFlags IsCompileTime="1"><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><QueryTimeStats ElapsedTime="0" CpuTime="0"></QueryTimeStats><RelOp NodeId="0" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1000" EstimateIO="0" EstimateCPU="0.0001" AvgRowSize="11" EstimatedTotalSubtreeCost="0.02221" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1003"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1003"></ColumnReference><ScalarOperator ScalarString="(1)"><Const ConstValue="(1)"></Const></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Merge Join" LogicalOp="Inner Join" EstimateRows="1000" EstimateIO="0" EstimateCPU="0.0099" AvgRowSize="9" EstimatedTotalSubtreeCost="0.02211" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Merge ManyToMany="0"><InnerSideJoinColumns><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></InnerSideJoinColumns><OuterSideJoinColumns><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></OuterSideJoinColumns><Residual><ScalarOperator ScalarString="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL1_TABLE].[ID] as [c1].[ID]=[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[BASE_TABLE].[ID] as [b].[ID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></Residual><RelOp NodeId="2" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="20" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="5" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1000" 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_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Index="[PK__COL1_TAB__3214EC270A5ED91A]" Alias="[c1]" IndexKind="Clustered" Storage="RowStore"></Object><Predicate><ScalarOperator ScalarString="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL1_TABLE].[COL1] as [c1].[COL1]=&apos;A&apos;"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="COL1"></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="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="15" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="5" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1000" 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_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Index="[PK__BASE_TAB__3214EC27704D9951]" Alias="[b]" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp></Merge></RelOp></ComputeScalar></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
 hidden batch(es)


DECLARE @Val BIGINT = 1 SELECT 1 FROM HugeView WHERE (Col1 = 'A' AND @val = 1) UNION ALL SELECT 1 FROM HugeView WHERE (Col2 = 'A' AND @Val = 0);
(No column name)
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Microsoft SQL Server 2005 XML Showplan
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.5" Build="13.0.4001.0"><BatchSequence><Batch><Statements><StmtSimple StatementText="SELECT 1 FROM HugeView&#xa;WHERE (Col1 = &apos;A&apos; AND @val = 1)&#xa;&#xa;UNION ALL&#xa;&#xa;SELECT 1 FROM HugeView&#xa;WHERE (Col2 = &apos;A&apos; AND @Val = 0)" StatementId="1" StatementCompId="2" StatementType="SELECT" RetrievedFromCache="true" StatementSubTreeCost="0.085371" StatementEstRows="660" SecurityPolicyApplied="false" StatementOptmLevel="FULL" QueryHash="0x1D573F25DB33E6C7" QueryPlanHash="0x81F65FF52C16D195" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="130"><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="1152" NonParallelPlanReason="NoParallelPlansInDesktopOrExpressEdition" CachedPlanSize="64" CompileTime="0" CompileCPU="0" CompileMemory="576"><MemoryGrantInfo SerialRequiredMemory="1024" SerialDesiredMemory="1152" RequiredMemory="1024" DesiredMemory="1152" RequestedMemory="1152" GrantWaitTime="0" GrantedMemory="1152" MaxUsedMemory="352" MaxQueryMemory="624408"></MemoryGrantInfo><OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="419378" EstimatedPagesCached="26211" EstimatedAvailableDegreeOfParallelism="1" MaxCompileMemory="1567984"></OptimizerHardwareDependentProperties><TraceFlags IsCompileTime="1"><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><TraceFlags IsCompileTime="0"><TraceFlag Value="8017" Scope="Global"></TraceFlag></TraceFlags><QueryTimeStats ElapsedTime="0" CpuTime="0"></QueryTimeStats><RelOp NodeId="0" PhysicalOp="Concatenation" LogicalOp="Concatenation" EstimateRows="660" EstimateIO="0" EstimateCPU="6.6e-005" AvgRowSize="11" EstimatedTotalSubtreeCost="0.085371" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Union1008"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Concat><DefinedValues><DefinedValue><ColumnReference Column="Union1008"></ColumnReference><ColumnReference Column="Expr1003"></ColumnReference><ColumnReference Column="Expr1007"></ColumnReference></DefinedValue></DefinedValues><RelOp NodeId="1" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="330" EstimateIO="0" EstimateCPU="3.3e-005" AvgRowSize="11" EstimatedTotalSubtreeCost="0.0426525" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1003"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1003"></ColumnReference><ScalarOperator ScalarString="(1)"><Const ConstValue="(1)"></Const></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="2" PhysicalOp="Hash Match" LogicalOp="Inner Join" EstimateRows="330" EstimateIO="0" EstimateCPU="0.0301295" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0426195" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList></OutputList><MemoryFractions Input="1" Output="1"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1152" OutputMemoryGrant="1152" UsedMemoryGrant="352"></RunTimeCountersPerThread></RunTimeInformation><Hash><DefinedValues></DefinedValues><HashKeysBuild><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></HashKeysBuild><HashKeysProbe><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></HashKeysProbe><ProbeResidual><ScalarOperator ScalarString="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL1_TABLE].[ID] as [c1].[ID]=[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[BASE_TABLE].[ID] as [b].[ID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></ProbeResidual><RelOp NodeId="3" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="330" EstimateIO="0" EstimateCPU="0.00028" AvgRowSize="15" EstimatedTotalSubtreeCost="0.00614348" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualRebinds="1" ActualRewinds="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Filter StartupExpression="1"><RelOp NodeId="4" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="15" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="5" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1000" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Index="[PK__BASE_TAB__3214EC27704D9951]" Alias="[b]" TableReferenceId="1" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp><Predicate><ScalarOperator ScalarString="[@Val]=(1)"><Identifier><ColumnReference Column="ConstExpr1009"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="@Val"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(1)"></Const></ScalarOperator></Compare></ScalarOperator></ColumnReference></Identifier></ScalarOperator></Predicate></Filter></RelOp><RelOp NodeId="5" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="20" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="1000" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="5" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualRowsRead="1000" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="ID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Index="[PK__COL1_TAB__3214EC270A5ED91A]" Alias="[c1]" TableReferenceId="1" IndexKind="Clustered" Storage="RowStore"></Object><Predicate><ScalarOperator ScalarString="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL1_TABLE].[COL1] as [c1].[COL1]=&apos;A&apos;"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL1_TABLE]" Alias="[c1]" Column="COL1"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="&apos;A&apos;"></Const></ScalarOperator></Compare></ScalarOperator></Predicate></IndexScan></RelOp></Hash></RelOp></ComputeScalar></RelOp><RelOp NodeId="6" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="330" EstimateIO="0" EstimateCPU="3.3e-005" AvgRowSize="11" EstimatedTotalSubtreeCost="0.0426525" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Column="Expr1007"></ColumnReference></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1007"></ColumnReference><ScalarOperator ScalarString="(1)"><Const ConstValue="(1)"></Const></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="7" PhysicalOp="Hash Match" LogicalOp="Inner Join" EstimateRows="330" EstimateIO="0" EstimateCPU="0.0301295" AvgRowSize="9" EstimatedTotalSubtreeCost="0.0426195" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList></OutputList><MemoryFractions Input="1" Output="1"></MemoryFractions><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="1" ActualExecutions="1" InputMemoryGrant="1152" OutputMemoryGrant="1152" UsedMemoryGrant="32"></RunTimeCountersPerThread></RunTimeInformation><Hash><DefinedValues></DefinedValues><HashKeysBuild><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></HashKeysBuild><HashKeysProbe><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="ID"></ColumnReference></HashKeysProbe><ProbeResidual><ScalarOperator ScalarString="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL2_TABLE].[ID] as [c2].[ID]=[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[BASE_TABLE].[ID] as [b].[ID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="ID"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></ProbeResidual><RelOp NodeId="8" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="330" EstimateIO="0" EstimateCPU="0.00028" AvgRowSize="15" EstimatedTotalSubtreeCost="0.00614348" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualRebinds="1" ActualRewinds="0" ActualEndOfScans="1" ActualExecutions="1"></RunTimeCountersPerThread></RunTimeInformation><Filter StartupExpression="1"><RelOp NodeId="9" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="15" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="0" ActualExecutions="0"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Alias="[b]" Column="ID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[BASE_TABLE]" Index="[PK__BASE_TAB__3214EC27704D9951]" Alias="[b]" TableReferenceId="2" IndexKind="Clustered" Storage="RowStore"></Object></IndexScan></RelOp><Predicate><ScalarOperator ScalarString="[@Val]=(0)"><Identifier><ColumnReference Column="ConstExpr1010"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="@Val"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"></Const></ScalarOperator></Compare></ScalarOperator></ColumnReference></Identifier></ScalarOperator></Predicate></Filter></RelOp><RelOp NodeId="10" PhysicalOp="Clustered Index Scan" LogicalOp="Clustered Index Scan" EstimateRows="1000" EstimatedRowsRead="1000" EstimateIO="0.00460648" EstimateCPU="0.001257" AvgRowSize="20" EstimatedTotalSubtreeCost="0.00586348" TableCardinality="1000" Parallel="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row"><OutputList><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="ID"></ColumnReference></OutputList><RunTimeInformation><RunTimeCountersPerThread Thread="0" ActualRows="0" Batches="0" ActualExecutionMode="Row" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="0" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" ActualEndOfScans="0" ActualExecutions="0"></RunTimeCountersPerThread></RunTimeInformation><IndexScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0" Storage="RowStore"><DefinedValues><DefinedValue><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="ID"></ColumnReference></DefinedValue></DefinedValues><Object Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Index="[PK__COL2_TAB__3214EC2772ED9C8B]" Alias="[c2]" TableReferenceId="2" IndexKind="Clustered" Storage="RowStore"></Object><Predicate><ScalarOperator ScalarString="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650].[dbo].[COL2_TABLE].[COL2] as [c2].[COL2]=&apos;A&apos;"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[fiddle_140fb7e9eb8a4158bd7a8b54cf254650]" Schema="[dbo]" Table="[COL2_TABLE]" Alias="[c2]" Column="COL2"></ColumnReference></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="&apos;A&apos;"></Const></ScalarOperator></Compare></ScalarOperator></Predicate></IndexScan></RelOp></Hash></RelOp></ComputeScalar></RelOp></Concat></RelOp><ParameterList><ColumnReference Column="@Val" ParameterDataType="bigint" ParameterRuntimeValue="(1)"></ColumnReference></ParameterList></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
 hidden batch(es)