Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="utf-16"?>
- <ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.2" Build="11.0.9231.13" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
- <BatchSequence>
- <Batch>
- <Statements>
- <StmtSimple StatementCompId="2" StatementEstRows="100" StatementId="1" StatementOptmLevel="FULL" StatementSubTreeCost="21.9051" StatementText="SELECT a.value('(child::text())[1]','INT')
FROM (VALUES (CONVERT(XML,
 '<b><a>'+REPLACE(@p_str,' ','</a><a>')+'</a></b>'
))) AS t(x)
CROSS APPLY x.nodes('//a') AS x(a)" StatementType="SELECT" QueryHash="0x775477326EA58929" QueryPlanHash="0xAB818A78810CB184" RetrievedFromCache="true">
- <StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
- <QueryPlan DegreeOfParallelism="1" CachedPlanSize="40" CompileTime="65" CompileCPU="4" CompileMemory="712">
- <MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" />
- <OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="1244765" EstimatedPagesCached="855776" EstimatedAvailableDegreeOfParallelism="5" />
- <RelOp AvgRowSize="11" EstimateCPU="1E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="100" LogicalOp="Compute Scalar" NodeId="0" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="21.9051">
- <OutputList>
- <ColumnReference Column="Expr1011" />
- </OutputList>
- <ComputeScalar>
- <DefinedValues>
- <DefinedValue>
- <ColumnReference Column="Expr1011" />
- <ScalarOperator ScalarString="[Expr1010]">
- <Identifier>
- <ColumnReference Column="Expr1010" />
- </Identifier>
- </ScalarOperator>
- </DefinedValue>
- </DefinedValues>
- <RelOp AvgRowSize="11" EstimateCPU="0.000418" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="100" LogicalOp="Inner Join" NodeId="1" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="21.9051">
- <OutputList>
- <ColumnReference Column="Expr1010" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRows="18" ActualEndOfScans="1" ActualExecutions="1" />
- </RunTimeInformation>
- <NestedLoops Optimized="false">
- <OuterReferences>
- <ColumnReference Column="Expr1000" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </OuterReferences>
- <RelOp AvgRowSize="4043" EstimateCPU="0.000418" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="100" LogicalOp="Inner Join" NodeId="2" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="1.00452">
- <OutputList>
- <ColumnReference Column="Expr1000" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRows="18" ActualEndOfScans="1" ActualExecutions="1" />
- </RunTimeInformation>
- <NestedLoops Optimized="false">
- <OuterReferences>
- <ColumnReference Column="Expr1000" />
- </OuterReferences>
- <RelOp AvgRowSize="4035" EstimateCPU="1.157E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Constant Scan" NodeId="3" Parallel="false" PhysicalOp="Constant Scan" EstimatedTotalSubtreeCost="1.157E-06">
- <OutputList>
- <ColumnReference Column="Expr1000" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRows="1" ActualEndOfScans="1" ActualExecutions="1" />
- </RunTimeInformation>
- <ConstantScan>
- <Values>
- <Row>
- <ScalarOperator ScalarString="CONVERT(xml,'<b><a>'+replace([@p_str],' ',CONVERT_IMPLICIT(varchar(max),'</a><a>',0))+'</a></b>',0)">
- <Convert DataType="xml" Style="0" Implicit="false">
- <ScalarOperator>
- <Arithmetic Operation="ADD">
- <ScalarOperator>
- <Arithmetic Operation="ADD">
- <ScalarOperator>
- <Const ConstValue="'<b><a>'" />
- </ScalarOperator>
- <ScalarOperator>
- <Intrinsic FunctionName="replace">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Column="@p_str" />
- </Identifier>
- </ScalarOperator>
- <ScalarOperator>
- <Const ConstValue="' '" />
- </ScalarOperator>
- <ScalarOperator>
- <Convert DataType="varchar(max)" Length="2147483647" Style="0" Implicit="true">
- <ScalarOperator>
- <Const ConstValue="'</a><a>'" />
- </ScalarOperator>
- </Convert>
- </ScalarOperator>
- </Intrinsic>
- </ScalarOperator>
- </Arithmetic>
- </ScalarOperator>
- <ScalarOperator>
- <Const ConstValue="'</a></b>'" />
- </ScalarOperator>
- </Arithmetic>
- </ScalarOperator>
- </Convert>
- </ScalarOperator>
- </Row>
- </Values>
- </ConstantScan>
- </RelOp>
- <RelOp AvgRowSize="17" EstimateCPU="9.6E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="100" LogicalOp="Filter" NodeId="5" Parallel="false" PhysicalOp="Filter" EstimatedTotalSubtreeCost="1.0041">
- <OutputList>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRebinds="1" ActualRewinds="0" ActualRows="18" ActualEndOfScans="1" ActualExecutions="1" />
- </RunTimeInformation>
- <Filter StartupExpression="true">
- <RelOp AvgRowSize="17" EstimateCPU="1.004" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="200" LogicalOp="Table-valued function" NodeId="6" Parallel="false" PhysicalOp="Table-valued function" EstimatedTotalSubtreeCost="1.004">
- <OutputList>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRebinds="1" ActualRewinds="0" ActualRows="18" ActualEndOfScans="1" ActualExecutions="1" />
- </RunTimeInformation>
- <TableValuedFunction>
- <DefinedValues>
- <DefinedValue>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </DefinedValue>
- </DefinedValues>
- <Object Table="[XML Reader with XPath filter]" />
- <ParameterList>
- <ScalarOperator ScalarString="[Expr1000]">
- <Identifier>
- <ColumnReference Column="Expr1000" />
- </Identifier>
- </ScalarOperator>
- <ScalarOperator ScalarString="(0)">
- <Const ConstValue="(0)" />
- </ScalarOperator>
- <ScalarOperator ScalarString="NULL">
- <Const ConstValue="NULL" />
- </ScalarOperator>
- <ScalarOperator ScalarString="NULL">
- <Const ConstValue="NULL" />
- </ScalarOperator>
- </ParameterList>
- </TableValuedFunction>
- </RelOp>
- <Predicate>
- <ScalarOperator ScalarString="[Expr1000] IS NOT NULL">
- <Compare CompareOp="IS NOT">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Column="Expr1000" />
- </Identifier>
- </ScalarOperator>
- <ScalarOperator>
- <Const ConstValue="NULL" />
- </ScalarOperator>
- </Compare>
- </ScalarOperator>
- </Predicate>
- </Filter>
- </RelOp>
- </NestedLoops>
- </RelOp>
- <RelOp AvgRowSize="11" EstimateCPU="1.1E-06" EstimateIO="0" EstimateRebinds="99" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Aggregate" NodeId="12" Parallel="false" PhysicalOp="Stream Aggregate" EstimatedTotalSubtreeCost="20.9001">
- <OutputList>
- <ColumnReference Column="Expr1010" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRows="18" ActualEndOfScans="0" ActualExecutions="18" />
- </RunTimeInformation>
- <StreamAggregate>
- <DefinedValues>
- <DefinedValue>
- <ColumnReference Column="Expr1010" />
- <ScalarOperator ScalarString="MIN(CASE WHEN [Expr1000] IS NULL THEN NULL ELSE CASE WHEN datalength(XML Reader with XPath filter.[value])>=(128) THEN CONVERT_IMPLICIT(int,XML Reader with XPath filter.[lvalue],0) ELSE CONVERT_IMPLICIT(int,XML Reader with XPath filter.[value],0) END END)">
- <Aggregate AggType="MIN" Distinct="false">
- <ScalarOperator>
- <IF>
- <Condition>
- <ScalarOperator>
- <Compare CompareOp="IS">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Column="Expr1000" />
- </Identifier>
- </ScalarOperator>
- <ScalarOperator>
- <Const ConstValue="NULL" />
- </ScalarOperator>
- </Compare>
- </ScalarOperator>
- </Condition>
- <Then>
- <ScalarOperator>
- <Const ConstValue="NULL" />
- </ScalarOperator>
- </Then>
- <Else>
- <ScalarOperator>
- <IF>
- <Condition>
- <ScalarOperator>
- <Compare CompareOp="GE">
- <ScalarOperator>
- <Intrinsic FunctionName="datalength">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="value" />
- </Identifier>
- </ScalarOperator>
- </Intrinsic>
- </ScalarOperator>
- <ScalarOperator>
- <Const ConstValue="(128)" />
- </ScalarOperator>
- </Compare>
- </ScalarOperator>
- </Condition>
- <Then>
- <ScalarOperator>
- <Convert DataType="int" Style="0" Implicit="true">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="lvalue" />
- </Identifier>
- </ScalarOperator>
- </Convert>
- </ScalarOperator>
- </Then>
- <Else>
- <ScalarOperator>
- <Convert DataType="int" Style="0" Implicit="true">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="value" />
- </Identifier>
- </ScalarOperator>
- </Convert>
- </ScalarOperator>
- </Else>
- </IF>
- </ScalarOperator>
- </Else>
- </IF>
- </ScalarOperator>
- </Aggregate>
- </ScalarOperator>
- </DefinedValue>
- </DefinedValues>
- <RelOp AvgRowSize="4057" EstimateCPU="1E-07" EstimateIO="0" EstimateRebinds="99" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Top" NodeId="13" Parallel="false" PhysicalOp="Top" EstimatedTotalSubtreeCost="20.9">
- <OutputList>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="value" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="lvalue" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRows="18" ActualEndOfScans="18" ActualExecutions="18" />
- </RunTimeInformation>
- <Top RowCount="false" IsPercent="false" WithTies="false">
- <TopExpression>
- <ScalarOperator ScalarString="(1)">
- <Const ConstValue="(1)" />
- </ScalarOperator>
- </TopExpression>
- <RelOp AvgRowSize="4517" EstimateCPU="4.78647E-07" EstimateIO="0" EstimateRebinds="99" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Compute Scalar" NodeId="14" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="20.9">
- <OutputList>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="value" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="lvalue" />
- <ColumnReference Column="Expr1009" />
- </OutputList>
- <ComputeScalar>
- <DefinedValues>
- <DefinedValue>
- <ColumnReference Column="Expr1009" />
- <ScalarOperator ScalarString="0x58">
- <Const ConstValue="0x58" />
- </ScalarOperator>
- </DefinedValue>
- </DefinedValues>
- <RelOp AvgRowSize="4065" EstimateCPU="1.224E-05" EstimateIO="0" EstimateRebinds="99" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="1" LogicalOp="Filter" NodeId="15" Parallel="false" PhysicalOp="Filter" EstimatedTotalSubtreeCost="20.9">
- <OutputList>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="value" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="lvalue" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRows="18" ActualEndOfScans="0" ActualExecutions="18" />
- </RunTimeInformation>
- <Filter StartupExpression="false">
- <RelOp AvgRowSize="4065" EstimateCPU="1.00036" EstimateIO="0" EstimateRebinds="99" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="3.7606" LogicalOp="Table-valued function" NodeId="16" Parallel="false" PhysicalOp="Table-valued function" EstimatedTotalSubtreeCost="20.8998">
- <OutputList>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="value" />
- <ColumnReference Table="[XML Reader with XPath filter]" Column="lvalue" />
- </OutputList>
- <RunTimeInformation>
- <RunTimeCountersPerThread Thread="0" ActualRebinds="18" ActualRewinds="0" ActualRows="18" ActualEndOfScans="0" ActualExecutions="18" />
- </RunTimeInformation>
- <TableValuedFunction>
- <DefinedValues>
- <DefinedValue>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </DefinedValue>
- <DefinedValue>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="value" />
- </DefinedValue>
- <DefinedValue>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="lvalue" />
- </DefinedValue>
- </DefinedValues>
- <Object Table="[XML Reader with XPath filter]" />
- <ParameterList>
- <ScalarOperator ScalarString="[Expr1000]">
- <Identifier>
- <ColumnReference Column="Expr1000" />
- </Identifier>
- </ScalarOperator>
- <ScalarOperator ScalarString="(7)">
- <Const ConstValue="(7)" />
- </ScalarOperator>
- <ScalarOperator ScalarString="XML Reader with XPath filter.[id]">
- <Identifier>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </Identifier>
- </ScalarOperator>
- <ScalarOperator ScalarString="getdescendantlimit(XML Reader with XPath filter.[id])">
- <Intrinsic FunctionName="getdescendantlimit">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </Identifier>
- </ScalarOperator>
- </Intrinsic>
- </ScalarOperator>
- </ParameterList>
- </TableValuedFunction>
- </RelOp>
- <Predicate>
- <ScalarOperator ScalarString="XML Reader with XPath filter.[id]=getancestor(XML Reader with XPath filter.[id],(1))">
- <Compare CompareOp="EQ">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </Identifier>
- </ScalarOperator>
- <ScalarOperator>
- <Intrinsic FunctionName="getancestor">
- <ScalarOperator>
- <Identifier>
- <ColumnReference Table="[XML Reader with XPath filter]" Column="id" />
- </Identifier>
- </ScalarOperator>
- <ScalarOperator>
- <Const ConstValue="(1)" />
- </ScalarOperator>
- </Intrinsic>
- </ScalarOperator>
- </Compare>
- </ScalarOperator>
- </Predicate>
- </Filter>
- </RelOp>
- </ComputeScalar>
- </RelOp>
- </Top>
- </RelOp>
- </StreamAggregate>
- </RelOp>
- </NestedLoops>
- </RelOp>
- </ComputeScalar>
- </RelOp>
- <ParameterList>
- <ColumnReference Column="@p_str" ParameterRuntimeValue="'78 91 01 12 34 56 78 91 01 12 34 56 78 91 01 12 34 56'" />
- </ParameterList>
- </QueryPlan>
- </StmtSimple>
- </Statements>
- </Batch>
- </BatchSequence>
- </ShowPlanXML>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement