Curious: performance difference when using function in a where clause.

  • Hello all,

    This is just something I noticed and am wondering about (I think this is an unexpected effect), there is no problem to solve.

    I get a performance difference when I use a function in a where clause. See the code, the performance numbers are below the code.

    Sorry I was not able to isolate the problem and give definitions and data to reproduce this.

    Please read the code.

    ------------------------------------------

    ------------------------------------------

    select * from client_order where

    -- ABS(ClientNr) = 12345

    ClientNr = 12345

    and

    startdttm = '2012-03-16'

    ----(1 row(s) affected)

    ----Table 'Encounter'. Scan count 30, logical reads 62, physical reads 61, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

    ---- SQL Server Execution Times:

    ---- CPU time = 0 ms, elapsed time = 765 ms.

    -- Estimated execution plan: Estimated Subtree Cost : 0.106408

    -- Actuel execution plan: Estimated Subtree Cost : 0.106408

    ------------------------------------------

    ------------------------------------------

    ------------------------------------------

    select * from client_order where

    ABS(ClientNr) = 12345

    -- ClientNr = 12345

    and

    startdttm = '2012-03-16'

    ----(1 row(s) affected)

    ----Table 'client_order'. Scan count 1, logical reads 4, physical reads 4, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

    ---- SQL Server Execution Times:

    ---- CPU time = 0 ms, elapsed time = 49 ms.

    -- Estimated execution plan: Estimated Subtree Cost : 0.0183334

    -- Actuel execution plan: Estimated Subtree Cost : 0.0183334

    ------------------------------------------

    ------------------------------------------

    Thanks for your time and attention,

    ben brugman

  • That's roughly the opposite of what you ought to see. Can you get both actual execution plans and post them so we can see what the optimizer is doing?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • I agree with Grant - you should see the SELECT with the function take longer, since it has to run over all the rows. I wonder if ClientNr is an integer and the first query was cached and the second one used the results of the first. Would the execution plan of the first be used by the second?

    I will be the first to say that Grant knows far more about execution plans than I.

  • Grant Fritchey (3/22/2013)


    Can you get both actual execution plans and post them so we can see what the optimizer is doing?

    I'll type it out,

    First

    Select

    Nested loops

    Index Seek (nonclusterd) cost 93%

    RID Lookup (Heap) cost 7 %

    Second

    Select

    Nested loops

    Compute Scalar

    Index Seek (nonclusterd) cost 18%

    RID Lookup (Heap) cost 82 %

    Both queries started with, this gives a level playing field.:

    SET STATISTICS TIME ON

    SET STATISTICS IO ON

    dbcc dropcleanbuffers

    dbcc freeproccache

    I expect dat dropping the index would give the better result for both queries. I can imagine that the optimiser chooses the wrong path and that the actual execution takes more resources, but here the query plan (both extimated and when run) give similar results.

    Ben

  • Sorry, I can't tell anything from that. You can export an execution plan as a .SQLPLAN file and then load it up to the web site. Then I can see what's going on in it.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (3/22/2013)


    Sorry, I can't tell anything from that. You can export an execution plan as a .SQLPLAN file and then load it up to the web site. Then I can see what's going on in it.

    First of all thanks for the offer.

    Yesterday I have tried to convert the actual situation into an 'artificial' situation, because it is my policy not to publish actual company tables and data to the internet.

    I know that part of the problem is 'caused' by partitioning. But I think even then the result is still curious, it is not an overly complex query. I think that removing the index would help the performance in this case.

    So here we have a situation that adding an index reduces performance when selecting.

    As said there is no actual problem, only a situation for me to learn from. Today I have another try to create an artificial situation from the production database. (I am not good with partitioned databases).

    Or I coud send it directly to you, the query plans.

    Thanks again for the offer,

    ben brugman

  • I think that's a good policy...don't ever publish real data. There are privacy, PII, HIPPA, etc. concerns that should never be overlooked unless you want a sudden change in your career.

    I think what Grant was asking for was the actual execution plan from the query. It'll tell what was being done where.

  • Ed Wagner (3/26/2013)


    I think that's a good policy...don't ever publish real data. There are privacy, PII, HIPPA, etc. concerns that should never be overlooked unless you want a sudden change in your career.

    I think what Grant was asking for was the actual execution plan from the query. It'll tell what was being done where.

    But that will include the query which could have data inside it. I understand why you can't post it, but then again, I can't make an intelligent suggestion without data.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Grant Fritchey (3/26/2013)


    Ed Wagner (3/26/2013)


    I think that's a good policy...don't ever publish real data. There are privacy, PII, HIPPA, etc. concerns that should never be overlooked unless you want a sudden change in your career.

    I think what Grant was asking for was the actual execution plan from the query. It'll tell what was being done where.

    But that will include the query which could have data inside it. I understand why you can't post it, but then again, I can't make an intelligent suggestion without data.

    I'll have a try now,

    I saved the query plans, used an editor to change the fields to the same fields as in the example. Instead of the * I used star_field. So this should obfuscate the query plan enough to publish it.

    The query plans are below, I do not know if there is a possibility to send as files, so I am using the xml code part. Sorry ?

    Also the changes were made with an editor, so there is a possibility that this is not 'consistent'

    Again as said this is just curiosity, not a problem,

    ben brugman

    The ABS code (efficient one)

    <?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.1" Build="10.50.1600.1" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">

    <BatchSequence>

    <Batch>

    <Statements>

    <StmtSimple StatementCompId="1" StatementEstRows="1" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" StatementSubTreeCost="0.0183334" StatementText="SELECT [star_field] FROM [client_order] WHERE abs([ClientNr])=@1 AND [startdttm]=@2" StatementType="SELECT" QueryHash="0xD78219E146A50A1E" QueryPlanHash="0x972D9275E1848E5D">

    <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="0" CachedPlanSize="32" CompileTime="6" CompileCPU="6" CompileMemory="424">

    <RelOp AvgRowSize="23" EstimateCPU="2.22423E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="5.32112" LogicalOp="Inner Join" NodeId="1" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0183302">

    <OutputList>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="star_field" />

    </OutputList>

    <RunTimeInformation>

    <RunTimeCountersPerThread Thread="0" ActualRows="1" ActualEndOfScans="1" ActualExecutions="1" />

    </RunTimeInformation>

    <NestedLoops Optimized="false">

    <OuterReferences>

    <ColumnReference Column="Bmk1000" />

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </OuterReferences>

    <RelOp AvgRowSize="19" EstimateCPU="5.32112E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="5.32112" LogicalOp="Compute Scalar" NodeId="2" Parallel="false" PhysicalOp="Compute Scalar" EstimatedTotalSubtreeCost="0.00328839">

    <OutputList>

    <ColumnReference Column="Bmk1000" />

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </OutputList>

    <ComputeScalar>

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    <ScalarOperator ScalarString="RangePartitionNew([KeyCo52],(0),(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17),(18),(19),(20),(21),(22),(23),(24),(25),(26),(27),(28),(29))">

    <Intrinsic FunctionName="RangePartitionNew">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Column="KeyCo52" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(0)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(1)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(2)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(3)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(4)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(5)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(6)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(7)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(8)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(9)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(10)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(11)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(12)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(13)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(14)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(15)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(16)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(17)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(18)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(19)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(20)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(21)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(22)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(23)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(24)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(25)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(26)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(27)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(28)" />

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(29)" />

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    </DefinedValue>

    </DefinedValues>

    <RelOp AvgRowSize="19" EstimateCPU="0.000162853" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="5.32112" LogicalOp="Index Seek" NodeId="3" Parallel="false" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="0.00328785" TableCardinality="63784">

    <OutputList>

    <ColumnReference Column="Bmk1000" />

    <ColumnReference Column="KeyCo52" />

    </OutputList>

    <RunTimeInformation>

    <RunTimeCountersPerThread Thread="0" ActualRows="1" ActualEndOfScans="1" ActualExecutions="1" />

    </RunTimeInformation>

    <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Bmk1000" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="KeyCo52" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Index="[client_order_STRTDTTM]" IndexKind="NonClustered" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="StartDTTM" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="'2012-03-16'">

    <Const ConstValue="'2012-03-16'" />

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    </ComputeScalar>

    </RelOp>

    <RelOp AvgRowSize="23" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="4.32112" EstimateRewinds="0" EstimateRows="1" LogicalOp="RID Lookup" NodeId="8" Parallel="false" Partitioned="true" PhysicalOp="RID Lookup" EstimatedTotalSubtreeCost="0.0150196" TableCardinality="63784">

    <OutputList>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="star_field" />

    </OutputList>

    <RunTimeInformation>

    <RunTimeCountersPerThread Thread="0" ActualRows="1" ActualEndOfScans="0" ActualExecutions="1" />

    </RunTimeInformation>

    <RunTimePartitionSummary>

    <PartitionsAccessed PartitionCount="1">

    <PartitionRange Start="15" End="15" />

    </PartitionsAccessed>

    </RunTimePartitionSummary>

    <IndexScan Lookup="true" Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="star_field" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" TableReferenceId="-1" IndexKind="Heap" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    <ColumnReference Column="Bmk1000" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[PtnId1001]">

    <Identifier>

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator ScalarString="[Bmk1000]">

    <Identifier>

    <ColumnReference Column="Bmk1000" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    <Predicate>

    <ScalarOperator ScalarString="abs([MyDatabase].[dbo].[client_order].[ClientNr])=(12345.)">

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Intrinsic FunctionName="abs">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="ClientNr" />

    </Identifier>

    </ScalarOperator>

    </Intrinsic>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="(12345.)" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Predicate>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <ParameterList>

    <ColumnReference Column="@2" ParameterCompiledValue="'2012-03-16'" ParameterRuntimeValue="'2012-03-16'" />

    <ColumnReference Column="@1" ParameterCompiledValue="(12345.)" ParameterRuntimeValue="(12345.)" />

    </ParameterList>

    </QueryPlan>

    </StmtSimple>

    </Statements>

    </Batch>

    </BatchSequence>

    </ShowPlanXML>

    The index code (not efficient one)

    <?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.1" Build="10.50.1600.1" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">

    <BatchSequence>

    <Batch>

    <Statements>

    <StmtSimple StatementCompId="1" StatementEstRows="3.24209" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" StatementSubTreeCost="0.106408" StatementText="SELECT [star_field] FROM [client_order] WHERE [ClientNr]=@1 AND [startdttm]=@2" StatementType="SELECT" QueryHash="0x93C524A6B52FC0EC" QueryPlanHash="0xAC7112C61607103E">

    <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="0" CachedPlanSize="24" CompileTime="8" CompileCPU="8" CompileMemory="384">

    <RelOp AvgRowSize="23" EstimateCPU="1.35519E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="3.24209" LogicalOp="Inner Join" NodeId="0" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.106408">

    <OutputList>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="star_field" />

    </OutputList>

    <RunTimeInformation>

    <RunTimeCountersPerThread Thread="0" ActualRows="1" ActualEndOfScans="1" ActualExecutions="1" />

    </RunTimeInformation>

    <NestedLoops Optimized="false">

    <OuterReferences>

    <ColumnReference Column="Bmk1000" />

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </OuterReferences>

    <RelOp AvgRowSize="19" EstimateCPU="0.00471357" EstimateIO="0.09375" EstimateRebinds="0" EstimateRewinds="0" EstimateRows="3.24209" LogicalOp="Index Seek" NodeId="1" Parallel="false" Partitioned="true" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="0.0984636" TableCardinality="63784">

    <OutputList>

    <ColumnReference Column="Bmk1000" />

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </OutputList>

    <RunTimeInformation>

    <RunTimeCountersPerThread Thread="0" ActualRows="1" ActualEndOfScans="1" ActualExecutions="1" />

    </RunTimeInformation>

    <RunTimePartitionSummary>

    <PartitionsAccessed PartitionCount="30">

    <PartitionRange Start="1" End="30" />

    </PartitionsAccessed>

    </RunTimePartitionSummary>

    <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Column="Bmk1000" />

    </DefinedValue>

    <DefinedValue>

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Index="[Client_ENDDT]" IndexKind="NonClustered" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <StartRange ScanType="GE">

    <RangeColumns>

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="(1)">

    <Const ConstValue="(1)" />

    </ScalarOperator>

    </RangeExpressions>

    </StartRange>

    <EndRange ScanType="LE">

    <RangeColumns>

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="(30)">

    <Const ConstValue="(30)" />

    </ScalarOperator>

    </RangeExpressions>

    </EndRange>

    </SeekKeys>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="ClientNr" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="(12345)">

    <Const ConstValue="(12345)" />

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    </IndexScan>

    </RelOp>

    <RelOp AvgRowSize="23" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="2.24209" EstimateRewinds="0" EstimateRows="1" LogicalOp="RID Lookup" NodeId="3" Parallel="false" Partitioned="true" PhysicalOp="RID Lookup" EstimatedTotalSubtreeCost="0.00793075" TableCardinality="63784">

    <OutputList>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="star_field" />

    </OutputList>

    <RunTimeInformation>

    <RunTimeCountersPerThread Thread="0" ActualRows="1" ActualEndOfScans="0" ActualExecutions="1" />

    </RunTimeInformation>

    <RunTimePartitionSummary>

    <PartitionsAccessed PartitionCount="1">

    <PartitionRange Start="15" End="15" />

    </PartitionsAccessed>

    </RunTimePartitionSummary>

    <IndexScan Lookup="true" Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" NoExpandHint="false">

    <DefinedValues>

    <DefinedValue>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="star_field" />

    </DefinedValue>

    </DefinedValues>

    <Object Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" TableReferenceId="-1" IndexKind="Heap" />

    <SeekPredicates>

    <SeekPredicateNew>

    <SeekKeys>

    <Prefix ScanType="EQ">

    <RangeColumns>

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    <ColumnReference Column="Bmk1000" />

    </RangeColumns>

    <RangeExpressions>

    <ScalarOperator ScalarString="[PtnId1001]">

    <Identifier>

    <ColumnReference Column="PtnId1001" ComputedColumn="true" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator ScalarString="[Bmk1000]">

    <Identifier>

    <ColumnReference Column="Bmk1000" />

    </Identifier>

    </ScalarOperator>

    </RangeExpressions>

    </Prefix>

    </SeekKeys>

    </SeekPredicateNew>

    </SeekPredicates>

    <Predicate>

    <ScalarOperator ScalarString="[MyDatabase].[dbo].[client_order].[StartDTTM]='2012-03-16'">

    <Compare CompareOp="EQ">

    <ScalarOperator>

    <Identifier>

    <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[client_order]" Column="StartDTTM" />

    </Identifier>

    </ScalarOperator>

    <ScalarOperator>

    <Const ConstValue="'2012-03-16'" />

    </ScalarOperator>

    </Compare>

    </ScalarOperator>

    </Predicate>

    </IndexScan>

    </RelOp>

    </NestedLoops>

    </RelOp>

    <ParameterList>

    <ColumnReference Column="@2" ParameterCompiledValue="'2012-03-16'" ParameterRuntimeValue="'2012-03-16'" />

    <ColumnReference Column="@1" ParameterCompiledValue="(12345.)" ParameterRuntimeValue="(12345.)" />

    </ParameterList>

    </QueryPlan>

    </StmtSimple>

    </Statements>

    </Batch>

    </BatchSequence>

    </ShowPlanXML>

  • hereby the plans uploaded.

    Hope this works. (This is a new area for me).

    ben

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply