Advertisement
SQL_Kiwi

Untitled

Feb 27th, 2017
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
T-SQL 97.46 KB | None | 0 0
  1. WITH    a6
  2.           AS ( SELECT   cdc.col2
  3.                        ,maxLimit.col11 AS col15Rule
  4.                        ,maxLimit.col15
  5.                FROM     table1 AS cdc
  6.                JOIN     table2 AS cdt
  7.                         ON cdt.col1 = cdc.col1
  8.                LEFT JOIN table3 AS ahcr
  9.                         ON ahcr.col9 = cdt.col1
  10.                OUTER APPLY ( SELECT TOP 1
  11.                                     rules.col11
  12.                                    ,rules.col15
  13.                              FROM   ( SELECT    clr.col11
  14.                                                ,clr.col15
  15.                                                ,Priority = ROW_NUMBER() OVER ( ORDER BY clr.col2 DESC, clr.col1 DESC, clr.col10 DESC, clr.col12 DESC, clr.col13 DESC, clr.col7 DESC , clr.col14 DESC )
  16.                                       FROM      table4 AS clr
  17.                                       WHERE     ( clr.col2 IS NULL
  18.                                                   OR clr.col2 = cdc.col2
  19.                                                 )
  20.                                                 AND ( clr.col1 IS NULL
  21.                                                       OR clr.col1 = cdc.col1
  22.                                                     )
  23.                                                 AND ( clr.col10 IS NULL
  24.                                                       OR clr.col10 = ahcr.col10
  25.                                                     )
  26.                                                 AND ( clr.col12 IS NULL
  27.                                                       OR clr.col12 = cdt.col8
  28.                                                     )
  29.                                                 AND ( clr.col13 IS NULL
  30.                                                       OR clr.col13 = cdc.col3
  31.                                                     )
  32.                                                 AND ( clr.col7 IS NULL
  33.                                                       OR clr.col7 = cdc.col7
  34.                                                     )
  35.                                                 AND ( clr.col14 IS NULL
  36.                                                       OR clr.col14 = cdc.col5
  37.                                                     )
  38.                                                 AND clr.col15 IS NOT NULL
  39.                                     ) AS rules
  40.                              WHERE  rules.Priority = 1
  41.                            ) maxLimit
  42.                WHERE    cdc.col6 = 4
  43.              )
  44.     SELECT  a1.[col2] AS [col22]
  45.            ,a4.[col2] AS [col23]
  46.     FROM    [dbo].[table1] a1
  47.     INNER JOIN [dbo].[table5] a2
  48.             ON a1.[col2] = a2.[col2]
  49.     INNER JOIN [dbo].[table6] a3
  50.             ON a2.[col2] = a3.[col18]
  51.     INNER JOIN [dbo].[table1] a4
  52.             ON a3.[col19] = a4.[col2]
  53.     INNER JOIN [dbo].[table5] a5
  54.             ON a4.[col2] = a5.[col2]
  55.     INNER JOIN a6
  56.             ON a6.col2 = a4.col2
  57.     WHERE   COALESCE(a5.[col17], a5.[col16], 0) < ISNULL(a6.[col15], 0)
  58.             AND NOT EXISTS ( SELECT 1
  59.                              FROM   [dbo].[table7] a7
  60.                              WHERE  a1.[col2] = a7.[col22]
  61.                                     AND a4.[col2] = a7.[col23] )
  62.             AND a1.col2 = '1234123412341234'
  63. OPTION (USE PLAN N'<?xml version="1.0" encoding="utf-16"?>
  64. <ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.5" Build="13.0.4411.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
  65.  <BatchSequence>
  66.    <Batch>
  67.      <Statements>
  68.        <StmtSimple StatementCompId="1" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="130" StatementSubTreeCost="0.0442385" StatementText="WITH    a6&#xD;&#xA;          AS ( SELECT   cdc.col2&#xD;&#xA;                       ,maxLimit.col11 AS col15Rule&#xD;&#xA;                       ,maxLimit.col15&#xD;&#xA;               FROM     table1 AS cdc &#xD;&#xA;               JOIN     table2 AS cdt &#xD;&#xA;                        ON cdt.col1 = cdc.col1&#xD;&#xA;               LEFT JOIN table3 AS ahcr &#xD;&#xA;                        ON ahcr.col9 = cdt.col1&#xD;&#xA;               OUTER APPLY ( SELECT TOP 1&#xD;&#xA;                                    rules.col11&#xD;&#xA;                                   ,rules.col15&#xD;&#xA;                             FROM   ( SELECT    clr.col11&#xD;&#xA;                                               ,clr.col15&#xD;&#xA;                                               ,Priority = ROW_NUMBER() OVER ( ORDER BY clr.col2 DESC, clr.col1 DESC, clr.col10 DESC, clr.col12 DESC, clr.col13 DESC, clr.col7 DESC , clr.col14 DESC )&#xD;&#xA;                                      FROM      table4 AS clr &#xD;&#xA;                                      WHERE     ( clr.col2 IS NULL&#xD;&#xA;                                                  OR clr.col2 = cdc.col2&#xD;&#xA;                                                )&#xD;&#xA;                                                AND ( clr.col1 IS NULL&#xD;&#xA;                                                      OR clr.col1 = cdc.col1&#xD;&#xA;                                                    )&#xD;&#xA;                                                AND ( clr.col10 IS NULL&#xD;&#xA;                                                      OR clr.col10 = ahcr.col10&#xD;&#xA;                                                    )&#xD;&#xA;                                                AND ( clr.col12 IS NULL&#xD;&#xA;                                                      OR clr.col12 = cdt.col8&#xD;&#xA;                                                    )&#xD;&#xA;                                                AND ( clr.col13 IS NULL&#xD;&#xA;                                                      OR clr.col13 = cdc.col3&#xD;&#xA;                                                    )&#xD;&#xA;                                                AND ( clr.col7 IS NULL&#xD;&#xA;                                                      OR clr.col7 = cdc.col7&#xD;&#xA;                                                    )&#xD;&#xA;                                                AND ( clr.col14 IS NULL&#xD;&#xA;                                                      OR clr.col14 = cdc.col5&#xD;&#xA;                                                    )&#xD;&#xA;                                                AND clr.col15 IS NOT NULL&#xD;&#xA;                                    ) AS rules&#xD;&#xA;                             WHERE  rules.Priority = 1&#xD;&#xA;                           ) maxLimit&#xD;&#xA;               WHERE    cdc.col6 = 4&#xD;&#xA;             )&#xD;&#xA;    SELECT  a1.[col2] AS [col22]&#xD;&#xA;           ,a4.[col2] AS [col23]&#xD;&#xA;    FROM    [dbo].[table1] a1 &#xD;&#xA;    INNER JOIN [dbo].[table5] a2 &#xD;&#xA;            ON a1.[col2] = a2.[col2]&#xD;&#xA;    INNER JOIN [dbo].[table6] a3 &#xD;&#xA;            ON a2.[col2] = a3.[col18]&#xD;&#xA;    INNER JOIN [dbo].[table1] a4 &#xD;&#xA;            ON a3.[col19] = a4.[col2]&#xD;&#xA;    INNER JOIN [dbo].[table5] a5 &#xD;&#xA;            ON a4.[col2] = a5.[col2]&#xD;&#xA;    INNER JOIN a6 &#xD;&#xA;            ON a6.col2 = a4.col2&#xD;&#xA;    WHERE   COALESCE(a5.[col17], a5.[col16], 0) &lt; ISNULL(a6.[col15], 0)&#xD;&#xA;            AND NOT EXISTS ( SELECT 1&#xD;&#xA;                             FROM   [dbo].[table7] a7&#xD;&#xA;                             WHERE  a1.[col2] = a7.[col22]&#xD;&#xA;                                    AND a4.[col2] = a7.[col23] )&#xD;&#xA;            AND a1.col2 = ''1234123412341234''" StatementType="SELECT" QueryHash="0x8E082042DBC266EA" QueryPlanHash="0x9879964BE6701F8B" RetrievedFromCache="false" SecurityPolicyApplied="false">
  69.          <StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
  70.          <QueryPlan CachedPlanSize="96" CompileTime="19" CompileCPU="19" CompileMemory="1432">
  71.            <MemoryGrantInfo SerialRequiredMemory="512" SerialDesiredMemory="544" />
  72.            <OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="209715" EstimatedPagesCached="52428" EstimatedAvailableDegreeOfParallelism="2" MaxCompileMemory="6723992" />
  73.            <RelOp AvgRowSize="63" EstimateCPU="6.8E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Filter" NodeId="0" Parallel="false" PhysicalOp="Filter" EstimatedTotalSubtreeCost="0.0442385">
  74.              <OutputList>
  75.                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  76.                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  77.              </OutputList>
  78.              <Filter StartupExpression="false">
  79.                <RelOp AvgRowSize="79" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Left Outer Join" NodeId="1" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0442378">
  80.                  <OutputList>
  81.                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  82.                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  83.                    <ColumnReference Column="Expr1011" />
  84.                    <ColumnReference Column="Expr1014" />
  85.                  </OutputList>
  86.                  <NestedLoops Optimized="false">
  87.                    <OuterReferences>
  88.                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  89.                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  90.                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  91.                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  92.                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  93.                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col8" />
  94.                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table3]" Alias="[ahcr]" Column="col10" />
  95.                    </OuterReferences>
  96.                    <RelOp AvgRowSize="197" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Left Outer Join" NodeId="2" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0295832">
  97.                      <OutputList>
  98.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  99.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  100.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  101.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  102.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  103.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  104.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  105.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col8" />
  106.                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table3]" Alias="[ahcr]" Column="col10" />
  107.                        <ColumnReference Column="Expr1014" />
  108.                      </OutputList>
  109.                      <NestedLoops Optimized="false">
  110.                        <OuterReferences>
  111.                          <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col1" />
  112.                        </OuterReferences>
  113.                        <RelOp AvgRowSize="220" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Inner Join" NodeId="3" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0262959">
  114.                          <OutputList>
  115.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  116.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  117.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  118.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  119.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  120.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  121.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  122.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col1" />
  123.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col8" />
  124.                            <ColumnReference Column="Expr1014" />
  125.                          </OutputList>
  126.                          <NestedLoops Optimized="false">
  127.                            <OuterReferences>
  128.                              <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  129.                            </OuterReferences>
  130.                            <RelOp AvgRowSize="140" EstimateCPU="1E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Compute Scalar" NodeId="4" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="0.0230086">
  131.                              <OutputList>
  132.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  133.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  134.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  135.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  136.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  137.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  138.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  139.                                <ColumnReference Column="Expr1014" />
  140.                              </OutputList>
  141.                              <ComputeScalar>
  142.                                <DefinedValues>
  143.                                  <DefinedValue>
  144.                                    <ColumnReference Column="Expr1014" />
  145.                                    <ScalarOperator ScalarString="CASE WHEN [Sandpit].[dbo].[table5].[col17] as [a5].[col17] IS NOT NULL THEN [Sandpit].[dbo].[table5].[col17] as [a5].[col17] ELSE CASE WHEN [Sandpit].[dbo].[table5].[col16] as [a5].[col16] IS NOT NULL THEN [Sandpit].[dbo].[table5].[col16] as [a5].[col16] ELSE ($0.0000) END END">
  146.                                      <IF>
  147.                                        <Condition>
  148.                                          <ScalarOperator>
  149.                                            <Compare CompareOp="IS NOT">
  150.                                              <ScalarOperator>
  151.                                                <Identifier>
  152.                                                  <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col17" />
  153.                                                </Identifier>
  154.                                              </ScalarOperator>
  155.                                              <ScalarOperator>
  156.                                                <Const ConstValue="NULL" />
  157.                                              </ScalarOperator>
  158.                                            </Compare>
  159.                                          </ScalarOperator>
  160.                                        </Condition>
  161.                                        <Then>
  162.                                          <ScalarOperator>
  163.                                            <Identifier>
  164.                                              <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col17" />
  165.                                            </Identifier>
  166.                                          </ScalarOperator>
  167.                                        </Then>
  168.                                        <Else>
  169.                                          <ScalarOperator>
  170.                                            <IF>
  171.                                              <Condition>
  172.                                                <ScalarOperator>
  173.                                                  <Compare CompareOp="IS NOT">
  174.                                                    <ScalarOperator>
  175.                                                      <Identifier>
  176.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col16" />
  177.                                                      </Identifier>
  178.                                                    </ScalarOperator>
  179.                                                    <ScalarOperator>
  180.                                                      <Const ConstValue="NULL" />
  181.                                                    </ScalarOperator>
  182.                                                  </Compare>
  183.                                                </ScalarOperator>
  184.                                              </Condition>
  185.                                              <Then>
  186.                                                <ScalarOperator>
  187.                                                  <Identifier>
  188.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col16" />
  189.                                                  </Identifier>
  190.                                                </ScalarOperator>
  191.                                              </Then>
  192.                                              <Else>
  193.                                                <ScalarOperator>
  194.                                                  <Const ConstValue="($0.0000)" />
  195.                                                </ScalarOperator>
  196.                                              </Else>
  197.                                            </IF>
  198.                                          </ScalarOperator>
  199.                                        </Else>
  200.                                      </IF>
  201.                                    </ScalarOperator>
  202.                                  </DefinedValue>
  203.                                </DefinedValues>
  204.                                <RelOp AvgRowSize="149" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Inner Join" NodeId="5" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0230085">
  205.                                  <OutputList>
  206.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  207.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  208.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col16" />
  209.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col17" />
  210.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  211.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  212.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  213.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  214.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  215.                                  </OutputList>
  216.                                  <NestedLoops Optimized="false">
  217.                                    <OuterReferences>
  218.                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  219.                                    </OuterReferences>
  220.                                    <RelOp AvgRowSize="132" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Left Anti Semi Join" NodeId="6" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0197212">
  221.                                      <OutputList>
  222.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  223.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  224.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  225.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  226.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  227.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  228.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  229.                                      </OutputList>
  230.                                      <NestedLoops Optimized="false">
  231.                                        <Predicate>
  232.                                          <ScalarOperator ScalarString="[Sandpit].[dbo].[table1].[col2] as [a4].[col2]=[Sandpit].[dbo].[table7].[col23] as [a7].[col23]">
  233.                                            <Compare CompareOp="EQ">
  234.                                              <ScalarOperator>
  235.                                                <Identifier>
  236.                                                  <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  237.                                                </Identifier>
  238.                                              </ScalarOperator>
  239.                                              <ScalarOperator>
  240.                                                <Identifier>
  241.                                                  <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table7]" Alias="[a7]" Column="col23" />
  242.                                                </Identifier>
  243.                                              </ScalarOperator>
  244.                                            </Compare>
  245.                                          </ScalarOperator>
  246.                                        </Predicate>
  247.                                        <RelOp AvgRowSize="132" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Inner Join" NodeId="7" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0164332">
  248.                                          <OutputList>
  249.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  250.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  251.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  252.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  253.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  254.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  255.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  256.                                          </OutputList>
  257.                                          <NestedLoops Optimized="false">
  258.                                            <OuterReferences>
  259.                                              <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  260.                                            </OuterReferences>
  261.                                            <RelOp AvgRowSize="63" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Inner Join" NodeId="8" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0131454">
  262.                                              <OutputList>
  263.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  264.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  265.                                              </OutputList>
  266.                                              <NestedLoops Optimized="false">
  267.                                                <RelOp AvgRowSize="9" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="9" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  268.                                                  <OutputList />
  269.                                                  <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  270.                                                    <DefinedValues />
  271.                                                    <Object Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Index="[UCX_table5_col2]" Alias="[a2]" IndexKind="Clustered" Storage="RowStore" />
  272.                                                    <SeekPredicates>
  273.                                                      <SeekPredicateNew>
  274.                                                        <SeekKeys>
  275.                                                          <Prefix ScanType="EQ">
  276.                                                            <RangeColumns>
  277.                                                              <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a2]" Column="col2" />
  278.                                                            </RangeColumns>
  279.                                                            <RangeExpressions>
  280.                                                              <ScalarOperator ScalarString="''1234123412341234''">
  281.                                                                <Const ConstValue="''1234123412341234''" />
  282.                                                              </ScalarOperator>
  283.                                                            </RangeExpressions>
  284.                                                          </Prefix>
  285.                                                        </SeekKeys>
  286.                                                      </SeekPredicateNew>
  287.                                                    </SeekPredicates>
  288.                                                  </IndexScan>
  289.                                                </RelOp>
  290.                                                <RelOp AvgRowSize="63" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Inner Join" NodeId="10" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.00985814">
  291.                                                  <OutputList>
  292.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  293.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  294.                                                  </OutputList>
  295.                                                  <NestedLoops Optimized="false">
  296.                                                    <RelOp AvgRowSize="36" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="11" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  297.                                                      <OutputList>
  298.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  299.                                                      </OutputList>
  300.                                                      <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  301.                                                        <DefinedValues>
  302.                                                          <DefinedValue>
  303.                                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  304.                                                          </DefinedValue>
  305.                                                        </DefinedValues>
  306.                                                        <Object Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Index="[PK_table1]" Alias="[a1]" IndexKind="Clustered" Storage="RowStore" />
  307.                                                        <SeekPredicates>
  308.                                                          <SeekPredicateNew>
  309.                                                            <SeekKeys>
  310.                                                              <Prefix ScanType="EQ">
  311.                                                                <RangeColumns>
  312.                                                                  <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a1]" Column="col2" />
  313.                                                                </RangeColumns>
  314.                                                                <RangeExpressions>
  315.                                                                  <ScalarOperator ScalarString="''1234123412341234''">
  316.                                                                    <Const ConstValue="''1234123412341234''" />
  317.                                                                  </ScalarOperator>
  318.                                                                </RangeExpressions>
  319.                                                              </Prefix>
  320.                                                            </SeekKeys>
  321.                                                          </SeekPredicateNew>
  322.                                                        </SeekPredicates>
  323.                                                      </IndexScan>
  324.                                                    </RelOp>
  325.                                                    <RelOp AvgRowSize="36" EstimateCPU="4.18E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Inner Join" NodeId="12" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.00657086">
  326.                                                      <OutputList>
  327.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  328.                                                      </OutputList>
  329.                                                      <NestedLoops Optimized="false">
  330.                                                        <OuterReferences>
  331.                                                          <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table6]" Alias="[a3]" Column="col19" />
  332.                                                        </OuterReferences>
  333.                                                        <RelOp AvgRowSize="63" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Scan" NodeId="13" Parallel="false" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  334.                                                          <OutputList>
  335.                                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table6]" Alias="[a3]" Column="col19" />
  336.                                                          </OutputList>
  337.                                                          <IndexScan Ordered="false" ForcedIndex="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  338.                                                            <DefinedValues>
  339.                                                              <DefinedValue>
  340.                                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table6]" Alias="[a3]" Column="col19" />
  341.                                                              </DefinedValue>
  342.                                                            </DefinedValues>
  343.                                                            <Object Database="[Sandpit]" Schema="[dbo]" Table="[table6]" Index="[PK_table6]" Alias="[a3]" IndexKind="Clustered" Storage="RowStore" />
  344.                                                            <Predicate>
  345.                                                              <ScalarOperator ScalarString="[Sandpit].[dbo].[table6].[col18] as [a3].[col18]=''1234123412341234''">
  346.                                                                <Compare CompareOp="EQ">
  347.                                                                  <ScalarOperator>
  348.                                                                    <Identifier>
  349.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table6]" Alias="[a3]" Column="col18" />
  350.                                                                    </Identifier>
  351.                                                                  </ScalarOperator>
  352.                                                                  <ScalarOperator>
  353.                                                                    <Const ConstValue="''1234123412341234''" />
  354.                                                                  </ScalarOperator>
  355.                                                                </Compare>
  356.                                                              </ScalarOperator>
  357.                                                            </Predicate>
  358.                                                          </IndexScan>
  359.                                                        </RelOp>
  360.                                                        <RelOp AvgRowSize="36" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="14" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  361.                                                          <OutputList>
  362.                                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  363.                                                          </OutputList>
  364.                                                          <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  365.                                                            <DefinedValues>
  366.                                                              <DefinedValue>
  367.                                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  368.                                                              </DefinedValue>
  369.                                                            </DefinedValues>
  370.                                                            <Object Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Index="[PK_table1]" Alias="[a4]" IndexKind="Clustered" Storage="RowStore" />
  371.                                                            <SeekPredicates>
  372.                                                              <SeekPredicateNew>
  373.                                                                <SeekKeys>
  374.                                                                  <Prefix ScanType="EQ">
  375.                                                                    <RangeColumns>
  376.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  377.                                                                    </RangeColumns>
  378.                                                                    <RangeExpressions>
  379.                                                                      <ScalarOperator ScalarString="[Sandpit].[dbo].[table6].[col19] as [a3].[col19]">
  380.                                                                        <Identifier>
  381.                                                                          <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table6]" Alias="[a3]" Column="col19" />
  382.                                                                        </Identifier>
  383.                                                                      </ScalarOperator>
  384.                                                                    </RangeExpressions>
  385.                                                                  </Prefix>
  386.                                                                </SeekKeys>
  387.                                                              </SeekPredicateNew>
  388.                                                            </SeekPredicates>
  389.                                                          </IndexScan>
  390.                                                        </RelOp>
  391.                                                      </NestedLoops>
  392.                                                    </RelOp>
  393.                                                  </NestedLoops>
  394.                                                </RelOp>
  395.                                              </NestedLoops>
  396.                                            </RelOp>
  397.                                            <RelOp AvgRowSize="80" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="15" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  398.                                              <OutputList>
  399.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  400.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  401.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  402.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  403.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  404.                                              </OutputList>
  405.                                              <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  406.                                                <DefinedValues>
  407.                                                  <DefinedValue>
  408.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  409.                                                  </DefinedValue>
  410.                                                  <DefinedValue>
  411.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  412.                                                  </DefinedValue>
  413.                                                  <DefinedValue>
  414.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  415.                                                  </DefinedValue>
  416.                                                  <DefinedValue>
  417.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  418.                                                  </DefinedValue>
  419.                                                  <DefinedValue>
  420.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  421.                                                  </DefinedValue>
  422.                                                </DefinedValues>
  423.                                                <Object Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Index="[PK_table1]" Alias="[cdc]" IndexKind="Clustered" Storage="RowStore" />
  424.                                                <SeekPredicates>
  425.                                                  <SeekPredicateNew>
  426.                                                    <SeekKeys>
  427.                                                      <Prefix ScanType="EQ">
  428.                                                        <RangeColumns>
  429.                                                          <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  430.                                                        </RangeColumns>
  431.                                                        <RangeExpressions>
  432.                                                          <ScalarOperator ScalarString="[Sandpit].[dbo].[table1].[col2] as [a4].[col2]">
  433.                                                            <Identifier>
  434.                                                              <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[a4]" Column="col2" />
  435.                                                            </Identifier>
  436.                                                          </ScalarOperator>
  437.                                                        </RangeExpressions>
  438.                                                      </Prefix>
  439.                                                    </SeekKeys>
  440.                                                  </SeekPredicateNew>
  441.                                                </SeekPredicates>
  442.                                                <Predicate>
  443.                                                  <ScalarOperator ScalarString="[Sandpit].[dbo].[table1].[col6] as [cdc].[col6]=(4)">
  444.                                                    <Compare CompareOp="EQ">
  445.                                                      <ScalarOperator>
  446.                                                        <Identifier>
  447.                                                          <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col6" />
  448.                                                        </Identifier>
  449.                                                      </ScalarOperator>
  450.                                                      <ScalarOperator>
  451.                                                        <Const ConstValue="(4)" />
  452.                                                      </ScalarOperator>
  453.                                                    </Compare>
  454.                                                  </ScalarOperator>
  455.                                                </Predicate>
  456.                                              </IndexScan>
  457.                                            </RelOp>
  458.                                          </NestedLoops>
  459.                                        </RelOp>
  460.                                        <RelOp AvgRowSize="63" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Scan" NodeId="16" Parallel="false" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  461.                                          <OutputList>
  462.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table7]" Alias="[a7]" Column="col23" />
  463.                                          </OutputList>
  464.                                          <IndexScan Ordered="false" ForcedIndex="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  465.                                            <DefinedValues>
  466.                                              <DefinedValue>
  467.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table7]" Alias="[a7]" Column="col23" />
  468.                                              </DefinedValue>
  469.                                            </DefinedValues>
  470.                                            <Object Database="[Sandpit]" Schema="[dbo]" Table="[table7]" Index="[PK_table7]" Alias="[a7]" IndexKind="Clustered" Storage="RowStore" />
  471.                                            <Predicate>
  472.                                              <ScalarOperator ScalarString="[Sandpit].[dbo].[table7].[col22] as [a7].[col22]=''1234123412341234''">
  473.                                                <Compare CompareOp="EQ">
  474.                                                  <ScalarOperator>
  475.                                                    <Identifier>
  476.                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table7]" Alias="[a7]" Column="col22" />
  477.                                                    </Identifier>
  478.                                                  </ScalarOperator>
  479.                                                  <ScalarOperator>
  480.                                                    <Const ConstValue="''1234123412341234''" />
  481.                                                  </ScalarOperator>
  482.                                                </Compare>
  483.                                              </ScalarOperator>
  484.                                            </Predicate>
  485.                                          </IndexScan>
  486.                                        </RelOp>
  487.                                      </NestedLoops>
  488.                                    </RelOp>
  489.                                    <RelOp AvgRowSize="23" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="17" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  490.                                      <OutputList>
  491.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col16" />
  492.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col17" />
  493.                                      </OutputList>
  494.                                      <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  495.                                        <DefinedValues>
  496.                                          <DefinedValue>
  497.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col16" />
  498.                                          </DefinedValue>
  499.                                          <DefinedValue>
  500.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col17" />
  501.                                          </DefinedValue>
  502.                                        </DefinedValues>
  503.                                        <Object Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Index="[UCX_table5_col2]" Alias="[a5]" IndexKind="Clustered" Storage="RowStore" />
  504.                                        <SeekPredicates>
  505.                                          <SeekPredicateNew>
  506.                                            <SeekKeys>
  507.                                              <Prefix ScanType="EQ">
  508.                                                <RangeColumns>
  509.                                                  <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table5]" Alias="[a5]" Column="col2" />
  510.                                                </RangeColumns>
  511.                                                <RangeExpressions>
  512.                                                  <ScalarOperator ScalarString="[Sandpit].[dbo].[table1].[col2] as [cdc].[col2]">
  513.                                                    <Identifier>
  514.                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  515.                                                    </Identifier>
  516.                                                  </ScalarOperator>
  517.                                                </RangeExpressions>
  518.                                              </Prefix>
  519.                                            </SeekKeys>
  520.                                          </SeekPredicateNew>
  521.                                        </SeekPredicates>
  522.                                      </IndexScan>
  523.                                    </RelOp>
  524.                                  </NestedLoops>
  525.                                </RelOp>
  526.                              </ComputeScalar>
  527.                            </RelOp>
  528.                            <RelOp AvgRowSize="88" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="18" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  529.                              <OutputList>
  530.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col1" />
  531.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col8" />
  532.                              </OutputList>
  533.                              <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  534.                                <DefinedValues>
  535.                                  <DefinedValue>
  536.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col1" />
  537.                                  </DefinedValue>
  538.                                  <DefinedValue>
  539.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col8" />
  540.                                  </DefinedValue>
  541.                                </DefinedValues>
  542.                                <Object Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Index="[PK_table2]" Alias="[cdt]" IndexKind="Clustered" Storage="RowStore" />
  543.                                <SeekPredicates>
  544.                                  <SeekPredicateNew>
  545.                                    <SeekKeys>
  546.                                      <Prefix ScanType="EQ">
  547.                                        <RangeColumns>
  548.                                          <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col1" />
  549.                                        </RangeColumns>
  550.                                        <RangeExpressions>
  551.                                          <ScalarOperator ScalarString="[Sandpit].[dbo].[table1].[col1] as [cdc].[col1]">
  552.                                            <Identifier>
  553.                                              <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  554.                                            </Identifier>
  555.                                          </ScalarOperator>
  556.                                        </RangeExpressions>
  557.                                      </Prefix>
  558.                                    </SeekKeys>
  559.                                  </SeekPredicateNew>
  560.                                </SeekPredicates>
  561.                              </IndexScan>
  562.                            </RelOp>
  563.                          </NestedLoops>
  564.                        </RelOp>
  565.                        <RelOp AvgRowSize="11" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Seek" NodeId="19" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  566.                          <OutputList>
  567.                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table3]" Alias="[ahcr]" Column="col10" />
  568.                          </OutputList>
  569.                          <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  570.                            <DefinedValues>
  571.                              <DefinedValue>
  572.                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table3]" Alias="[ahcr]" Column="col10" />
  573.                              </DefinedValue>
  574.                            </DefinedValues>
  575.                            <Object Database="[Sandpit]" Schema="[dbo]" Table="[table3]" Index="[PK_table3]" Alias="[ahcr]" IndexKind="Clustered" Storage="RowStore" />
  576.                            <SeekPredicates>
  577.                              <SeekPredicateNew>
  578.                                <SeekKeys>
  579.                                  <Prefix ScanType="EQ">
  580.                                    <RangeColumns>
  581.                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table3]" Alias="[ahcr]" Column="col9" />
  582.                                    </RangeColumns>
  583.                                    <RangeExpressions>
  584.                                      <ScalarOperator ScalarString="[Sandpit].[dbo].[table2].[col1] as [cdt].[col1]">
  585.                                        <Identifier>
  586.                                          <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col1" />
  587.                                        </Identifier>
  588.                                      </ScalarOperator>
  589.                                    </RangeExpressions>
  590.                                  </Prefix>
  591.                                </SeekKeys>
  592.                              </SeekPredicateNew>
  593.                            </SeekPredicates>
  594.                          </IndexScan>
  595.                        </RelOp>
  596.                      </NestedLoops>
  597.                    </RelOp>
  598.                    <RelOp AvgRowSize="15" EstimateCPU="1E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Top" NodeId="20" Parallel="false" PhysicalOp="Top" EstimatedTotalSubtreeCost="0.0146505">
  599.                      <OutputList>
  600.                        <ColumnReference Column="Expr1011" />
  601.                      </OutputList>
  602.                      <Top RowCount="false" IsPercent="false" WithTies="false">
  603.                        <TopExpression>
  604.                          <ScalarOperator ScalarString="(1)">
  605.                            <Const ConstValue="(1)" />
  606.                          </ScalarOperator>
  607.                        </TopExpression>
  608.                        <RelOp AvgRowSize="15" EstimateCPU="4.8E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Filter" NodeId="21" Parallel="false" PhysicalOp="Filter" EstimatedTotalSubtreeCost="0.0146504">
  609.                          <OutputList>
  610.                            <ColumnReference Column="Expr1011" />
  611.                          </OutputList>
  612.                          <Filter StartupExpression="false">
  613.                            <RelOp AvgRowSize="23" EstimateCPU="1E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Compute Scalar" NodeId="22" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="0.0146499">
  614.                              <OutputList>
  615.                                <ColumnReference Column="Expr1009" />
  616.                                <ColumnReference Column="Expr1011" />
  617.                              </OutputList>
  618.                              <ComputeScalar>
  619.                                <DefinedValues>
  620.                                  <DefinedValue>
  621.                                    <ColumnReference Column="Expr1011" />
  622.                                    <ScalarOperator ScalarString="[Sandpit].[dbo].[table4].[col15] as [clr].[col15]">
  623.                                      <Identifier>
  624.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col15" />
  625.                                      </Identifier>
  626.                                    </ScalarOperator>
  627.                                  </DefinedValue>
  628.                                </DefinedValues>
  629.                                <RelOp AvgRowSize="23" EstimateCPU="1E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Top" NodeId="23" Parallel="false" PhysicalOp="Top" EstimatedTotalSubtreeCost="0.0146498">
  630.                                  <OutputList>
  631.                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col15" />
  632.                                    <ColumnReference Column="Expr1009" />
  633.                                  </OutputList>
  634.                                  <Top RowCount="false" IsPercent="false" WithTies="false">
  635.                                    <TopExpression>
  636.                                      <ScalarOperator ScalarString="CASE WHEN (1) IS NULL OR (1)&lt;(0) THEN (0) ELSE (1) END">
  637.                                        <IF>
  638.                                          <Condition>
  639.                                            <ScalarOperator>
  640.                                              <Logical Operation="OR">
  641.                                                <ScalarOperator>
  642.                                                  <Compare CompareOp="IS">
  643.                                                    <ScalarOperator>
  644.                                                      <Const ConstValue="(1)" />
  645.                                                    </ScalarOperator>
  646.                                                    <ScalarOperator>
  647.                                                      <Const ConstValue="NULL" />
  648.                                                    </ScalarOperator>
  649.                                                  </Compare>
  650.                                                </ScalarOperator>
  651.                                                <ScalarOperator>
  652.                                                  <Compare CompareOp="LT">
  653.                                                    <ScalarOperator>
  654.                                                      <Const ConstValue="(1)" />
  655.                                                    </ScalarOperator>
  656.                                                    <ScalarOperator>
  657.                                                      <Const ConstValue="(0)" />
  658.                                                    </ScalarOperator>
  659.                                                  </Compare>
  660.                                                </ScalarOperator>
  661.                                              </Logical>
  662.                                            </ScalarOperator>
  663.                                          </Condition>
  664.                                          <Then>
  665.                                            <ScalarOperator>
  666.                                              <Const ConstValue="(0)" />
  667.                                            </ScalarOperator>
  668.                                          </Then>
  669.                                          <Else>
  670.                                            <ScalarOperator>
  671.                                              <Const ConstValue="(1)" />
  672.                                            </ScalarOperator>
  673.                                          </Else>
  674.                                        </IF>
  675.                                      </ScalarOperator>
  676.                                    </TopExpression>
  677.                                    <RelOp AvgRowSize="23" EstimateCPU="8E-08" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Compute Scalar" NodeId="24" Parallel="false" PhysicalOp="Sequence Project" EstimatedTotalSubtreeCost="0.0146497">
  678.                                      <OutputList>
  679.                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col15" />
  680.                                        <ColumnReference Column="Expr1009" />
  681.                                      </OutputList>
  682.                                      <SequenceProject>
  683.                                        <DefinedValues>
  684.                                          <DefinedValue>
  685.                                            <ColumnReference Column="Expr1009" />
  686.                                            <ScalarOperator ScalarString="row_number">
  687.                                              <Sequence FunctionName="row_number" />
  688.                                            </ScalarOperator>
  689.                                          </DefinedValue>
  690.                                        </DefinedValues>
  691.                                        <RelOp AvgRowSize="23" EstimateCPU="2E-08" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Segment" NodeId="25" Parallel="false" PhysicalOp="Segment" EstimatedTotalSubtreeCost="0.0146496">
  692.                                          <OutputList>
  693.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col2" />
  694.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col1" />
  695.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col10" />
  696.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col12" />
  697.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col13" />
  698.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col7" />
  699.                                            <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col15" />
  700.                                            <ColumnReference Column="Segment1015" />
  701.                                          </OutputList>
  702.                                          <Segment>
  703.                                            <GroupBy />
  704.                                            <SegmentColumn>
  705.                                              <ColumnReference Column="Segment1015" />
  706.                                            </SegmentColumn>
  707.                                            <RelOp AvgRowSize="137" EstimateCPU="0.000100137" EstimateIO="0.0112613" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Sort" NodeId="26" Parallel="false" PhysicalOp="Sort" EstimatedTotalSubtreeCost="0.0146496">
  708.                                              <OutputList>
  709.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col2" />
  710.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col1" />
  711.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col10" />
  712.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col12" />
  713.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col13" />
  714.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col7" />
  715.                                                <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col15" />
  716.                                              </OutputList>
  717.                                              <MemoryFractions Input="1" Output="1" />
  718.                                              <Sort Distinct="false">
  719.                                                <OrderBy>
  720.                                                  <OrderByColumn Ascending="false">
  721.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col2" />
  722.                                                  </OrderByColumn>
  723.                                                  <OrderByColumn Ascending="false">
  724.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col1" />
  725.                                                  </OrderByColumn>
  726.                                                  <OrderByColumn Ascending="false">
  727.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col10" />
  728.                                                  </OrderByColumn>
  729.                                                  <OrderByColumn Ascending="false">
  730.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col12" />
  731.                                                  </OrderByColumn>
  732.                                                  <OrderByColumn Ascending="false">
  733.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col13" />
  734.                                                  </OrderByColumn>
  735.                                                  <OrderByColumn Ascending="false">
  736.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col7" />
  737.                                                  </OrderByColumn>
  738.                                                </OrderBy>
  739.                                                <RelOp AvgRowSize="142" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" EstimatedRowsRead="1" LogicalOp="Clustered Index Scan" NodeId="27" Parallel="false" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.0032831" TableCardinality="0">
  740.                                                  <OutputList>
  741.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col2" />
  742.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col1" />
  743.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col10" />
  744.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col12" />
  745.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col13" />
  746.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col7" />
  747.                                                    <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col15" />
  748.                                                  </OutputList>
  749.                                                  <IndexScan Ordered="false" ForcedIndex="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  750.                                                    <DefinedValues>
  751.                                                      <DefinedValue>
  752.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col2" />
  753.                                                      </DefinedValue>
  754.                                                      <DefinedValue>
  755.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col1" />
  756.                                                      </DefinedValue>
  757.                                                      <DefinedValue>
  758.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col10" />
  759.                                                      </DefinedValue>
  760.                                                      <DefinedValue>
  761.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col12" />
  762.                                                      </DefinedValue>
  763.                                                      <DefinedValue>
  764.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col13" />
  765.                                                      </DefinedValue>
  766.                                                      <DefinedValue>
  767.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col7" />
  768.                                                      </DefinedValue>
  769.                                                      <DefinedValue>
  770.                                                        <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col15" />
  771.                                                      </DefinedValue>
  772.                                                    </DefinedValues>
  773.                                                    <Object Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Index="[PK_table4]" Alias="[clr]" IndexKind="Clustered" Storage="RowStore" />
  774.                                                    <Predicate>
  775.                                                      <ScalarOperator ScalarString="[Sandpit].[dbo].[table4].[col15] as [clr].[col15] IS NOT NULL AND [Sandpit].[dbo].[table4].[col14] as [clr].[col14]=[Sandpit].[dbo].[table1].[col5] as [cdc].[col5] AND ([Sandpit].[dbo].[table4].[col2] as [clr].[col2] IS NULL OR [Sandpit].[dbo].[table4].[col2] as [clr].[col2]=[Sandpit].[dbo].[table1].[col2] as [cdc].[col2]) AND ([Sandpit].[dbo].[table4].[col1] as [clr].[col1] IS NULL OR [Sandpit].[dbo].[table4].[col1] as [clr].[col1]=[Sandpit].[dbo].[table1].[col1] as [cdc].[col1]) AND ([Sandpit].[dbo].[table4].[col10] as [clr].[col10] IS NULL OR [Sandpit].[dbo].[table4].[col10] as [clr].[col10]=[Sandpit].[dbo].[table3].[col10] as [ahcr].[col10]) AND ([Sandpit].[dbo].[table4].[col12] as [clr].[col12] IS NULL OR [Sandpit].[dbo].[table4].[col12] as [clr].[col12]=[Sandpit].[dbo].[table2].[col8] as [cdt].[col8]) AND ([Sandpit].[dbo].[table4].[col13] as [clr].[col13] IS NULL OR [Sandpit].[dbo].[table4].[col13] as [clr].[col13]=[Sandpit].[dbo].[table1].[col3] as [cdc].[col3]) AND ([Sandpit].[dbo].[table4].[col7] as [clr].[col7] IS NULL OR [Sandpit].[dbo].[table4].[col7] as [clr].[col7]=[Sandpit].[dbo].[table1].[col7] as [cdc].[col7])">
  776.                                                        <Logical Operation="AND">
  777.                                                          <ScalarOperator>
  778.                                                            <Compare CompareOp="IS NOT">
  779.                                                              <ScalarOperator>
  780.                                                                <Identifier>
  781.                                                                  <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col15" />
  782.                                                                </Identifier>
  783.                                                              </ScalarOperator>
  784.                                                              <ScalarOperator>
  785.                                                                <Const ConstValue="NULL" />
  786.                                                              </ScalarOperator>
  787.                                                            </Compare>
  788.                                                          </ScalarOperator>
  789.                                                          <ScalarOperator>
  790.                                                            <Compare CompareOp="EQ">
  791.                                                              <ScalarOperator>
  792.                                                                <Identifier>
  793.                                                                  <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col14" />
  794.                                                                </Identifier>
  795.                                                              </ScalarOperator>
  796.                                                              <ScalarOperator>
  797.                                                                <Identifier>
  798.                                                                  <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col5" />
  799.                                                                </Identifier>
  800.                                                              </ScalarOperator>
  801.                                                            </Compare>
  802.                                                          </ScalarOperator>
  803.                                                          <ScalarOperator>
  804.                                                            <Logical Operation="OR">
  805.                                                              <ScalarOperator>
  806.                                                                <Compare CompareOp="IS">
  807.                                                                  <ScalarOperator>
  808.                                                                    <Identifier>
  809.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col2" />
  810.                                                                    </Identifier>
  811.                                                                  </ScalarOperator>
  812.                                                                  <ScalarOperator>
  813.                                                                    <Const ConstValue="NULL" />
  814.                                                                  </ScalarOperator>
  815.                                                                </Compare>
  816.                                                              </ScalarOperator>
  817.                                                              <ScalarOperator>
  818.                                                                <Compare CompareOp="EQ">
  819.                                                                  <ScalarOperator>
  820.                                                                    <Identifier>
  821.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col2" />
  822.                                                                    </Identifier>
  823.                                                                  </ScalarOperator>
  824.                                                                  <ScalarOperator>
  825.                                                                    <Identifier>
  826.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col2" />
  827.                                                                    </Identifier>
  828.                                                                  </ScalarOperator>
  829.                                                                </Compare>
  830.                                                              </ScalarOperator>
  831.                                                            </Logical>
  832.                                                          </ScalarOperator>
  833.                                                          <ScalarOperator>
  834.                                                            <Logical Operation="OR">
  835.                                                              <ScalarOperator>
  836.                                                                <Compare CompareOp="IS">
  837.                                                                  <ScalarOperator>
  838.                                                                    <Identifier>
  839.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col1" />
  840.                                                                    </Identifier>
  841.                                                                  </ScalarOperator>
  842.                                                                  <ScalarOperator>
  843.                                                                    <Const ConstValue="NULL" />
  844.                                                                  </ScalarOperator>
  845.                                                                </Compare>
  846.                                                              </ScalarOperator>
  847.                                                              <ScalarOperator>
  848.                                                                <Compare CompareOp="EQ">
  849.                                                                  <ScalarOperator>
  850.                                                                    <Identifier>
  851.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col1" />
  852.                                                                    </Identifier>
  853.                                                                  </ScalarOperator>
  854.                                                                  <ScalarOperator>
  855.                                                                    <Identifier>
  856.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col1" />
  857.                                                                    </Identifier>
  858.                                                                  </ScalarOperator>
  859.                                                                </Compare>
  860.                                                              </ScalarOperator>
  861.                                                            </Logical>
  862.                                                          </ScalarOperator>
  863.                                                          <ScalarOperator>
  864.                                                            <Logical Operation="OR">
  865.                                                              <ScalarOperator>
  866.                                                                <Compare CompareOp="IS">
  867.                                                                  <ScalarOperator>
  868.                                                                    <Identifier>
  869.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col10" />
  870.                                                                    </Identifier>
  871.                                                                  </ScalarOperator>
  872.                                                                  <ScalarOperator>
  873.                                                                    <Const ConstValue="NULL" />
  874.                                                                  </ScalarOperator>
  875.                                                                </Compare>
  876.                                                              </ScalarOperator>
  877.                                                              <ScalarOperator>
  878.                                                                <Compare CompareOp="EQ">
  879.                                                                  <ScalarOperator>
  880.                                                                    <Identifier>
  881.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col10" />
  882.                                                                    </Identifier>
  883.                                                                  </ScalarOperator>
  884.                                                                  <ScalarOperator>
  885.                                                                    <Identifier>
  886.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table3]" Alias="[ahcr]" Column="col10" />
  887.                                                                    </Identifier>
  888.                                                                  </ScalarOperator>
  889.                                                                </Compare>
  890.                                                              </ScalarOperator>
  891.                                                            </Logical>
  892.                                                          </ScalarOperator>
  893.                                                          <ScalarOperator>
  894.                                                            <Logical Operation="OR">
  895.                                                              <ScalarOperator>
  896.                                                                <Compare CompareOp="IS">
  897.                                                                  <ScalarOperator>
  898.                                                                    <Identifier>
  899.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col12" />
  900.                                                                    </Identifier>
  901.                                                                  </ScalarOperator>
  902.                                                                  <ScalarOperator>
  903.                                                                    <Const ConstValue="NULL" />
  904.                                                                  </ScalarOperator>
  905.                                                                </Compare>
  906.                                                              </ScalarOperator>
  907.                                                              <ScalarOperator>
  908.                                                                <Compare CompareOp="EQ">
  909.                                                                  <ScalarOperator>
  910.                                                                    <Identifier>
  911.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col12" />
  912.                                                                    </Identifier>
  913.                                                                  </ScalarOperator>
  914.                                                                  <ScalarOperator>
  915.                                                                    <Identifier>
  916.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table2]" Alias="[cdt]" Column="col8" />
  917.                                                                    </Identifier>
  918.                                                                  </ScalarOperator>
  919.                                                                </Compare>
  920.                                                              </ScalarOperator>
  921.                                                            </Logical>
  922.                                                          </ScalarOperator>
  923.                                                          <ScalarOperator>
  924.                                                            <Logical Operation="OR">
  925.                                                              <ScalarOperator>
  926.                                                                <Compare CompareOp="IS">
  927.                                                                  <ScalarOperator>
  928.                                                                    <Identifier>
  929.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col13" />
  930.                                                                    </Identifier>
  931.                                                                  </ScalarOperator>
  932.                                                                  <ScalarOperator>
  933.                                                                    <Const ConstValue="NULL" />
  934.                                                                  </ScalarOperator>
  935.                                                                </Compare>
  936.                                                              </ScalarOperator>
  937.                                                              <ScalarOperator>
  938.                                                                <Compare CompareOp="EQ">
  939.                                                                  <ScalarOperator>
  940.                                                                    <Identifier>
  941.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col13" />
  942.                                                                    </Identifier>
  943.                                                                  </ScalarOperator>
  944.                                                                  <ScalarOperator>
  945.                                                                    <Identifier>
  946.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col3" />
  947.                                                                    </Identifier>
  948.                                                                  </ScalarOperator>
  949.                                                                </Compare>
  950.                                                              </ScalarOperator>
  951.                                                            </Logical>
  952.                                                          </ScalarOperator>
  953.                                                          <ScalarOperator>
  954.                                                            <Logical Operation="OR">
  955.                                                              <ScalarOperator>
  956.                                                                <Compare CompareOp="IS">
  957.                                                                  <ScalarOperator>
  958.                                                                    <Identifier>
  959.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col7" />
  960.                                                                    </Identifier>
  961.                                                                  </ScalarOperator>
  962.                                                                  <ScalarOperator>
  963.                                                                    <Const ConstValue="NULL" />
  964.                                                                  </ScalarOperator>
  965.                                                                </Compare>
  966.                                                              </ScalarOperator>
  967.                                                              <ScalarOperator>
  968.                                                                <Compare CompareOp="EQ">
  969.                                                                  <ScalarOperator>
  970.                                                                    <Identifier>
  971.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table4]" Alias="[clr]" Column="col7" />
  972.                                                                    </Identifier>
  973.                                                                  </ScalarOperator>
  974.                                                                  <ScalarOperator>
  975.                                                                    <Identifier>
  976.                                                                      <ColumnReference Database="[Sandpit]" Schema="[dbo]" Table="[table1]" Alias="[cdc]" Column="col7" />
  977.                                                                    </Identifier>
  978.                                                                  </ScalarOperator>
  979.                                                                </Compare>
  980.                                                              </ScalarOperator>
  981.                                                            </Logical>
  982.                                                          </ScalarOperator>
  983.                                                        </Logical>
  984.                                                      </ScalarOperator>
  985.                                                    </Predicate>
  986.                                                  </IndexScan>
  987.                                                </RelOp>
  988.                                              </Sort>
  989.                                            </RelOp>
  990.                                          </Segment>
  991.                                        </RelOp>
  992.                                      </SequenceProject>
  993.                                    </RelOp>
  994.                                  </Top>
  995.                                </RelOp>
  996.                              </ComputeScalar>
  997.                            </RelOp>
  998.                            <Predicate>
  999.                              <ScalarOperator ScalarString="[Expr1009]=(1)">
  1000.                                <Compare CompareOp="EQ">
  1001.                                  <ScalarOperator>
  1002.                                    <Identifier>
  1003.                                      <ColumnReference Column="Expr1009" />
  1004.                                    </Identifier>
  1005.                                  </ScalarOperator>
  1006.                                  <ScalarOperator>
  1007.                                    <Const ConstValue="(1)" />
  1008.                                  </ScalarOperator>
  1009.                                </Compare>
  1010.                              </ScalarOperator>
  1011.                            </Predicate>
  1012.                          </Filter>
  1013.                        </RelOp>
  1014.                      </Top>
  1015.                    </RelOp>
  1016.                  </NestedLoops>
  1017.                </RelOp>
  1018.                <Predicate>
  1019.                  <ScalarOperator ScalarString="[Expr1014]&lt;isnull([Expr1011],($0.0000))">
  1020.                    <Compare CompareOp="LT">
  1021.                      <ScalarOperator>
  1022.                        <Identifier>
  1023.                          <ColumnReference Column="Expr1014" />
  1024.                        </Identifier>
  1025.                      </ScalarOperator>
  1026.                      <ScalarOperator>
  1027.                        <Intrinsic FunctionName="isnull">
  1028.                          <ScalarOperator>
  1029.                            <Identifier>
  1030.                              <ColumnReference Column="Expr1011" />
  1031.                            </Identifier>
  1032.                          </ScalarOperator>
  1033.                          <ScalarOperator>
  1034.                            <Const ConstValue="($0.0000)" />
  1035.                          </ScalarOperator>
  1036.                        </Intrinsic>
  1037.                      </ScalarOperator>
  1038.                    </Compare>
  1039.                  </ScalarOperator>
  1040.                </Predicate>
  1041.              </Filter>
  1042.            </RelOp>
  1043.          </QueryPlan>
  1044.        </StmtSimple>
  1045.      </Statements>
  1046.    </Batch>
  1047.  </BatchSequence>
  1048. </ShowPlanXML>');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement