Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Dazed & confused

Author  Topic 

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 08:08:27
I have a query that is executed in less than a second. Whenever I add a new condition (marked in blue) to the where clause, the execution time increases to more than 10 Minutes!!! How is this possible?
I tried to include the expression in the relationship condition and the result is the same. What's wrong?
SELECT DeliverydatePackingSlip,
RessourceID,
COUNT(RessourceID) as Tot_Operations,
SUM(CASE WHEN DiffPromiseDateFirst > 0 THEN 1 ELSE 0 END) as Tot_LateOnFPD,
SUM(CASE WHEN DiffDaysToBackward > 0 THEN 1 ELSE 0 END) as Tot_LateOnBWSD,
SUM(CASE WHEN ResourceDelay > 0 THEN 1 ELSE 0 END) as Tot_LateOnRoute,
SUM(CASE WHEN DiffDaysToBackward > 0 and ResourceDelay > 0 THEN 1 ELSE 0 END) as LateOnBWSD,
SUM(CASE WHEN DiffPromiseDateFirst > 0 AND ResourceDelay > 0 THEN 1 ELSE 0 END) as LateOnFPD
from
(
SELECT Y.DeliverydatePackingSlip, X.ProductionID, X.RessourceID, Y.DiffPromiseDateFirst, P.DiffDaysToBackward, X.ResourceDelay

FROM iq4bisprocess.FactOTDCustomer Y
inner join iq4bisprocess.FactOTDProduction P on Y.Salesid = P.Salesid and Y.LineNum = P.SalesLineNum
inner join

(SELECT a.ProductionID, a.FinishedDate, a.RessourceID,
CASE WHEN a.ord = 1 OR a.DiffDays <= 0 THEN a.DiffDays ELSE a.DiffDays - b.DiffDays END as ResourceDelay

FROM
(SELECT FinishedDate, PRODUCTIONID, RessourceID, OperationID,
DiffDays, OperationFinished,
row_number() over(partition by PRODUCTIONID ORDER BY OPERATIONID) as ord
FROM iq4bisprocess.FactOTDRessource)a

left outer join

(SELECT ProductionID, DiffDays,
row_number() over(partition by PRODUCTIONID ORDER BY OPERATIONID) as ord
FROM iq4bisprocess.FactOTDRessource)b

on a.ProductionID = b.ProductionID and a.ord = b.ord+1
)X

on X.ProductionID = P.ProductionID *)Z

WHERE DeliverydatePackingSlip < DATEADD(day, DATEDIFF(day, 0, getdate()-1), 0) and
DeliverydatePackingSlip > DATEADD(day, DATEDIFF(day, 0, getdate()-366), 0) and
RessourceID = '200012'

GROUP BY DeliverydatePackingSlip, RessourceID
ORDER BY DeliverydatePackingSlip desc
I marked the portion of the query where RessourceID is defined in red to make it somewhat more clearer. The blue asterisk marks where I tried to place the condition as part of the relationship.

Martin

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-16 : 10:22:46
Look at the execution plan for both queries. I bet that the second one(with the extra condition) results in an extra table scan. Is the column ResourceID indexed? Are your statistics up to date?
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 11:29:53
Sorry, but I don't know how to answer this... execution plan? Do you mean the graphical depiction of the query, or its two portions? Neither of them can be depicted, but executed! The tables don't have Indexes and I can't tell anysthing about the Statistics... all these tables are fact tables in our datawarehouse. But I'm afraid I don't know anything about the cube building stuff and just need to access that tables for reporting...

I separated the queries with the "with clause", but when I finally do the "group by" it took again more than 10 minutes. I then thought to do the grouping and summing-up in Excel, where the data needs to be imported later. I added the "where condition" and the query could be executed within a second. 'Bingo' I thought, but then I realised that I still had to add the final "order by" before exporting... and this killed it again as it took the usual 10 minutes.

with Production as 

(SELECT a.ProductionID, a.FinishedDate, a.RessourceID,
CASE WHEN a.ord = 1 OR a.DiffDays <= 0 THEN a.DiffDays ELSE a.DiffDays - b.DiffDays END as ResourceDelay

from
(SELECT FinishedDate, PRODUCTIONID, RessourceID, OperationID,
DiffDays, OperationFinished,
row_number() over(partition by PRODUCTIONID ORDER BY OPERATIONID) as ord
from iq4bisprocess.FactOTDRessource)a

left outer join

(SELECT ProductionID, DiffDays,
row_number() over(partition by PRODUCTIONID ORDER BY OPERATIONID) as ord
FROM iq4bisprocess.FactOTDRessource)b
on a.ProductionID = b.ProductionID and a.ord = b.ord+1
WHERE RessourceID = '200012'),

Customers as
(SELECT ProductionID, DeliverydatePackingSlip, DiffPromiseDateFirst, Y.Salesid, Y.LineNum, DiffDaysToBackward
FROM iq4bisprocess.FactOTDCustomer Y
inner join iq4bisprocess.FactOTDProduction P on Y.Salesid = P.Salesid and Y.LineNum = P.SalesLineNum
WHERE DeliverydatePackingSlip < DATEADD(day, DATEDIFF(day, 0, getdate()-1), 0) and
DeliverydatePackingSlip > DATEADD(day, DATEDIFF(day, 0, getdate()-366), 0))


Select DeliverydatePackingSlip, RessourceID, DiffPromiseDateFirst, DiffDaysToBackward, ResourceDelay
from Customers inner Join production on Customers.ProductionID = Production.ProductionID

I can order in a second using a column from Production.
Ordering by DeliverydatePackingSlip from Customers -which is what I need to do- takes again the 10 minutes. It drives me crazy...
Go to Top of Page

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-02-16 : 13:56:53
Execution plan is what you get in SSMS when you click on Show Execution Plan or Show Actual Execution Plan. Yes, it is a graphical depiction of the query and it gives lots of insight into what is going on. Generate plans with and without your changes then look for the differences. BTW you can see execution plans for any query you like.

If the tables are not indexed, that's probably your problem right there, though I'd be surprised if Fact tables in a DW were not indexed and question the design!

Operators like Group by and Order by cause SQL to add sort steps. Depending on the size of the data, that can add significant runtime but if you need the results grouped and/or ordered, you have to live with it. On the bright side, SQL will sort faster than Excel for larger row sets.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-16 : 14:23:39
quote:
The tables don't have Indexes


Are you sure? That doesn't make sense.

Show us the execution plan in XML format: Open a new query window. Run this at the top: SET SHOWPLAN_XML ON; GO;. Now run your query. Post the XML output with code tags.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 14:24:19
Thank you, I see there is still lots of stuff to discover in SQL. Though its strange that I step on this only after this. I will take my time to learn...

But now that I need a quick solution I have great difficulties to accept that the fact the query takes 10 minutes to execute is due to the reason you mentioned.
But you can wipe away my doubts if you can confirm that under the mentioned circumstances, the following behavior is explainable:

Simplified:

select * from table
(takes a second and returns 5000 records)


select * from (select * from table)A
order by date

(takes 10 minutes)

I mean, the inner query which takes a second doesn't have to be recalculated, it can be considered as static table that just has to be ordered. Or am I wrong?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-16 : 14:34:01
We'll need to see the execution plan to help.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 14:55:39
OK, I ran the above command and the execution plan showed up. Great, how can I post it here?
The message that showed up sounds like a hint to that you were right with suspecting a missing Index:

Query 1: Query cost (relative to the batch): 100%
Select ....
Missing Index (Impact 10,4677): CREATE NONCLUSTERED INDEX [<Name of Missing Index, sysname,> ON [....

So, am I wrong with the assumption described in my last post that if the inner query takes one second it can be considered as a static table that just needs to be reordered, which wouldn't justify a 10 minutes execution time?

If this finally is due to the missing indexation, is there a workaround or do I have to ask the guys that work on the cubes to force indexation on that column(s)?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-16 : 14:59:34
Just copy/paste it in here. We'll copy/paste it into our environments to read it. There are tools that we use to help read it, though some can read it in the xml format.

Yes that second query is like a static table, but the queries are different since the second has an order by. The ordering is a performance hit. An index helps with that.

You will need to add indexes to support your queries. This must be a small data warehouse to have only come across this issue now. Any large data warehouse would be indexes, otherwise it would be unusable.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 15:09:40
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.1" Build="10.50.6000.34"><BatchSequence><Batch><Statements><StmtSimple StatementText="#xd;#xa;SELECT Y.DeliverydatePackingSlip, X.ProductionID, X.RessourceID, Y.DiffPromiseDateFirst, P.DiffDaysToBackward, X.ResourceDelay #xd;#xa;from #xd;#xa;(#xd;#xa;SELECT DeliverydatePackingSlip, DiffPromiseDateFirst, Salesid, LineNum, row_number() over(ORDER BY DeliverydatePackingSlip) as ID#xd;#xa;from iq4bisprocess.FactOTDCustomer) Y#xd;#xa;#xd;#xa;inner join iq4bisprocess.FactOTDProduction P on Y.Salesid = P.Salesid and Y.LineNum = P.SalesLineNum #xd;#xa;#xd;#xa;inner join #xd;#xa;#xd;#xa;(SELECT a.ProductionID, a.FinishedDate, a.RessourceID,#xd;#xa;#x9; CASE WHEN a.ord = 1 OR a.DiffDays <= 0 THEN a.DiffDays ELSE a.DiffDays - b.DiffDays END as ResourceDelay#xd;#xa;#xd;#xa;from#xd;#xa;(SELECT FinishedDate, PRODUCTIONID, RessourceID, OperationID,#xd;#xa;#x9; DiffDays, OperationFinished,#xd;#xa;#x9; row_number() over(partition by PRODUCTIONID ORDER BY OPERATIONID) as ord#xd;#xa;from iq4bisprocess.FactOTDRessource)a#xd;#xa;#xd;#xa;left outer join #xd;#xa;#xd;#xa;(SELECT ProductionID, DiffDays, row_number() over(partition by PRODUCTIONID ORDER BY OPERATIONID) as ord #xd;#xa;from iq4bisprocess.FactOTDRessource)b#xd;#xa;on a.ProductionID = b.ProductionID and a.ord = b.ord+1)X#xd;#xa;#xd;#xa;on X.ProductionID = P.ProductionID#xd;#xa;#xd;#xa;WHERE X.RessourceID = '200012' and Y.DeliverydatePackingSlip < DATEADD(day, DATEDIFF(day, 0, getdate()-1), 0) and Y.DeliverydatePackingSlip > DATEADD(day, DATEDIFF(day, 0, getdate()-366), 0)#xd;#xa;#xd;#xa;ORDER by ID DESC#xd;#xa;" StatementId="1" StatementCompId="1" StatementType="SELECT" StatementSubTreeCost="33.6922" StatementEstRows="1.97214" StatementOptmLevel="FULL" QueryHash="0xBA461EF643B8894C" QueryPlanHash="0x3A9D46CED3BC95D2"><StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false"/><QueryPlan CachedPlanSize="88" CompileTime="17" CompileCPU="17" CompileMemory="1224"><MissingIndexes><MissingIndexGroup Impact="10.4677"><MissingIndex Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]"><ColumnGroup Usage="EQUALITY"><Column Name="[SalesID]" ColumnId="20"/><Column Name="[SalesLineNum]" ColumnId="21"/></ColumnGroup><ColumnGroup Usage="INCLUDE"><Column Name="[ProductionID]" ColumnId="1"/><Column Name="[DiffDaysToBackward]" ColumnId="113"/></ColumnGroup></MissingIndex></MissingIndexGroup></MissingIndexes><RelOp NodeId="0" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1.97214" EstimateIO="0.0112613" EstimateCPU="0.000103087" AvgRowSize="73" EstimatedTotalSubtreeCost="33.6922" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Column="Expr1021"/></OutputList><MemoryFractions Input="0.00515464" Output="1"/><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="0"><ColumnReference Column="Expr1004"/></OrderByColumn></OrderBy><RelOp NodeId="1" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1.97214" EstimateIO="0" EstimateCPU="1.97214e-007" AvgRowSize="73" EstimatedTotalSubtreeCost="33.6808" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Column="Expr1021"/></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1021"/><ScalarOperator ScalarString="CASE WHEN [Expr1012]=(1) OR [ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[DiffDays]<=(0) THEN [ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[DiffDays] ELSE [ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[DiffDays]-[Expr1019] END"><IF><Condition><ScalarOperator><Logical Operation="OR"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1012"/></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(1)"/></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="LE"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(0)"/></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></Condition><Then><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></Identifier></ScalarOperator></Then><Else><ScalarOperator><Arithmetic Operation="SUB"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Column="Expr1019"/></Identifier></ScalarOperator></Arithmetic></ScalarOperator></Else></IF></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="2" PhysicalOp="Merge Join" LogicalOp="Left Outer Join" EstimateRows="1.97214" EstimateIO="0.000475569" EstimateCPU="0.132948" AvgRowSize="86" EstimatedTotalSubtreeCost="33.6808" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/><ColumnReference Column="Expr1012"/><ColumnReference Column="Expr1019"/></OutputList><Merge ManyToMany="1"><InnerSideJoinColumns><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Column="Expr1024"/></InnerSideJoinColumns><OuterSideJoinColumns><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Column="Expr1012"/></OuterSideJoinColumns><Residual><ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[ProductionID]=[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[ProductionID] AND [Expr1012]=([Expr1017]+(1))"><Logical Operation="AND"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></Identifier></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Column="Expr1012"/></Identifier></ScalarOperator><ScalarOperator><Arithmetic Operation="ADD"><ScalarOperator><Identifier><ColumnReference Column="Expr1017"/></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(1)"/></ScalarOperator></Arithmetic></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></Residual><RelOp NodeId="3" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1.51939" EstimateIO="0.0112613" EstimateCPU="0.000101534" AvgRowSize="104" EstimatedTotalSubtreeCost="24.5374" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/><ColumnReference Column="Expr1012"/></OutputList><MemoryFractions Input="0.00459242" Output="0.00515464"/><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/></OrderByColumn><OrderByColumn Ascending="1"><ColumnReference Column="Expr1012"/></OrderByColumn></OrderBy><RelOp NodeId="4" PhysicalOp="Merge Join" LogicalOp="Inner Join" EstimateRows="1.51939" EstimateIO="0.000313" EstimateCPU="0.00567307" AvgRowSize="104" EstimatedTotalSubtreeCost="24.526" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/><ColumnReference Column="Expr1012"/></OutputList><Merge ManyToMany="1"><InnerSideJoinColumns><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></InnerSideJoinColumns><OuterSideJoinColumns><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/></OuterSideJoinColumns><Residual><ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[ProductionID]=[ES02001_DWH].[iq4bisprocess].[FactOTDProduction].[ProductionID] as [P].[ProductionID]"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/></Identifier></ScalarOperator></Compare></ScalarOperator></Residual><RelOp NodeId="5" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1" EstimateIO="0.0112613" EstimateCPU="0.000100055" AvgRowSize="55" EstimatedTotalSubtreeCost="15.4931" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/></OutputList><MemoryFractions Input="0.5" Output="0.00459242"/><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/></OrderByColumn></OrderBy><RelOp NodeId="6" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="0.130462" AvgRowSize="55" EstimatedTotalSubtreeCost="15.4818" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/></OutputList><NestedLoops Optimized="0"><Predicate><ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDCustomer].[SALESID]=[ES02001_DWH].[iq4bisprocess].[FactOTDProduction].[SalesID] as [P].[SalesID] AND [ES02001_DWH].[iq4bisprocess].[FactOTDCustomer].[linenum]=[ES02001_DWH].[iq4bisprocess].[FactOTDProduction].[SalesLineNum] as [P].[SalesLineNum]"><Logical Operation="AND"><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID"/></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesID"/></Identifier></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum"/></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesLineNum"/></Identifier></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></Predicate><RelOp NodeId="7" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1" EstimateIO="0.0112613" EstimateCPU="0.00010006" AvgRowSize="60" EstimatedTotalSubtreeCost="11.9511" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/></OutputList><MemoryFractions Input="0.0027972" Output="0.5"/><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="0"><ColumnReference Column="Expr1004"/></OrderByColumn></OrderBy><RelOp NodeId="8" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="1" EstimateIO="0" EstimateCPU="0.0891651" AvgRowSize="60" EstimatedTotalSubtreeCost="11.9397" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/></OutputList><Filter StartupExpression="0"><RelOp NodeId="9" PhysicalOp="Sequence Project" LogicalOp="Compute Scalar" EstimateRows="101324" EstimateIO="0" EstimateCPU="0.00810592" AvgRowSize="60" EstimatedTotalSubtreeCost="11.8506" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Expr1004"/></OutputList><SequenceProject><DefinedValues><DefinedValue><ColumnReference Column="Expr1004"/><ScalarOperator ScalarString="row_number"><Sequence FunctionName="row_number"/></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="10" PhysicalOp="Segment" LogicalOp="Segment" EstimateRows="101324" EstimateIO="0" EstimateCPU="0.00202648" AvgRowSize="60" EstimatedTotalSubtreeCost="11.8425" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/><ColumnReference Column="Segment1025"/></OutputList><Segment><GroupBy/><SegmentColumn><ColumnReference Column="Segment1025"/></SegmentColumn><RelOp NodeId="11" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="101324" EstimateIO="0.0112613" EstimateCPU="7.73369" AvgRowSize="52" EstimatedTotalSubtreeCost="11.8404" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/></OutputList><MemoryFractions Input="1" Output="0.997203"/><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/></OrderByColumn></OrderBy><RelOp NodeId="12" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="101324" EstimateIO="3.98394" EstimateCPU="0.111535" AvgRowSize="52" EstimatedTotalSubtreeCost="4.09548" TableCardinality="101324" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/></OutputList><TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0"><DefinedValues><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst"/></DefinedValue></DefinedValues><Object Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" IndexKind="Heap"/></TableScan></RelOp></Sort></RelOp></Segment></RelOp></SequenceProject></RelOp><Predicate><ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDCustomer].[DeliverydatePackingSlip]<dateadd(day,datediff(day,'1900-01-01 00:00:00.000',getdate()-'1900-01-02 00:00:00.000'),'1900-01-01 00:00:00.000') AND [ES02001_DWH].[iq4bisprocess].[FactOTDCustomer].[DeliverydatePackingSlip]>dateadd(day,datediff(day,'1900-01-01 00:00:00.000',getdate()-'1901-01-02 00:00:00.000'),'1900-01-01 00:00:00.000')"><Logical Operation="AND"><ScalarOperator><Compare CompareOp="LT"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Column="ConstExpr1022"><ScalarOperator><Intrinsic FunctionName="dateadd"><ScalarOperator><Const ConstValue="(4)"/></ScalarOperator><ScalarOperator><Intrinsic FunctionName="datediff"><ScalarOperator><Const ConstValue="(4)"/></ScalarOperator><ScalarOperator><Const ConstValue="'1900-01-01 00:00:00.000'"/></ScalarOperator><ScalarOperator><Arithmetic Operation="SUB"><ScalarOperator><Intrinsic FunctionName="getdate"/></ScalarOperator><ScalarOperator><Const ConstValue="'1900-01-02 00:00:00.000'"/></ScalarOperator></Arithmetic></ScalarOperator></Intrinsic></ScalarOperator><ScalarOperator><Const ConstValue="'1900-01-01 00:00:00.000'"/></ScalarOperator></Intrinsic></ScalarOperator></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator><ScalarOperator><Compare CompareOp="GT"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip"/></Identifier></ScalarOperator><ScalarOperator><Identifier><ColumnReference Column="ConstExpr1023"><ScalarOperator><Intrinsic FunctionName="dateadd"><ScalarOperator><Const ConstValue="(4)"/></ScalarOperator><ScalarOperator><Intrinsic FunctionName="datediff"><ScalarOperator><Const ConstValue="(4)"/></ScalarOperator><ScalarOperator><Const ConstValue="'1900-01-01 00:00:00.000'"/></ScalarOperator><ScalarOperator><Arithmetic Operation="SUB"><ScalarOperator><Intrinsic FunctionName="getdate"/></ScalarOperator><ScalarOperator><Const ConstValue="'1901-01-02 00:00:00.000'"/></ScalarOperator></Arithmetic></ScalarOperator></Intrinsic></ScalarOperator><ScalarOperator><Const ConstValue="'1900-01-01 00:00:00.000'"/></ScalarOperator></Intrinsic></ScalarOperator></ColumnReference></Identifier></ScalarOperator></Compare></ScalarOperator></Logical></ScalarOperator></Predicate></Filter></RelOp></Sort></RelOp><RelOp NodeId="17" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="31211" EstimateIO="3.34387" EstimateCPU="0.0344891" AvgRowSize="74" EstimatedTotalSubtreeCost="3.37835" TableCardinality="31211" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesLineNum"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/></OutputList><TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0"><DefinedValues><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesID"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesLineNum"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward"/></DefinedValue></DefinedValues><Object Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" IndexKind="Heap"/></TableScan></RelOp></NestedLoops></RelOp></Sort></RelOp><RelOp NodeId="19" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="13771.5" EstimateIO="0" EstimateCPU="0.0290899" AvgRowSize="57" EstimatedTotalSubtreeCost="9.02693" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/><ColumnReference Column="Expr1012"/></OutputList><Filter StartupExpression="0"><RelOp NodeId="20" PhysicalOp="Sequence Project" LogicalOp="Compute Scalar" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.00484832" AvgRowSize="57" EstimatedTotalSubtreeCost="8.99784" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/><ColumnReference Column="Expr1012"/></OutputList><SequenceProject><DefinedValues><DefinedValue><ColumnReference Column="Expr1012"/><ScalarOperator ScalarString="row_number"><Sequence FunctionName="row_number"/></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="21" PhysicalOp="Segment" LogicalOp="Segment" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.00121208" AvgRowSize="57" EstimatedTotalSubtreeCost="8.99299" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/><ColumnReference Column="Segment1026"/></OutputList><Segment><GroupBy><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></GroupBy><SegmentColumn><ColumnReference Column="Segment1026"/></SegmentColumn><RelOp NodeId="22" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="60604" EstimateIO="0.0112613" EstimateCPU="4.41946" AvgRowSize="53" EstimatedTotalSubtreeCost="8.99178" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></OutputList><MemoryFractions Input="0.990815" Output="0.990815"/><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></OrderByColumn><OrderByColumn Ascending="1"><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/></OrderByColumn></OrderBy><RelOp NodeId="23" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="60604" EstimateIO="4.49424" EstimateCPU="0.0668214" AvgRowSize="53" EstimatedTotalSubtreeCost="4.56106" TableCardinality="60604" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></OutputList><TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0"><DefinedValues><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></DefinedValue></DefinedValues><Object Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" TableReferenceId="1" IndexKind="Heap"/></TableScan></RelOp></Sort></RelOp></Segment></RelOp></SequenceProject></RelOp><Predicate><ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[RessourceID]=N'200012'"><Compare CompareOp="EQ"><ScalarOperator><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID"/></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="N'200012'"/></ScalarOperator></Compare></ScalarOperator></Predicate></Filter></RelOp></Merge></RelOp></Sort></RelOp><RelOp NodeId="29" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.0060604" AvgRowSize="51" EstimatedTotalSubtreeCost="9.00996" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Column="Expr1017"/><ColumnReference Column="Expr1019"/><ColumnReference Column="Expr1024"/></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1024"/><ScalarOperator ScalarString="[Expr1017]+(1)"><Arithmetic Operation="ADD"><ScalarOperator><Identifier><ColumnReference Column="Expr1017"/></Identifier></ScalarOperator><ScalarOperator><Const ConstValue="(1)"/></ScalarOperator></Arithmetic></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="30" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.0060604" AvgRowSize="43" EstimatedTotalSubtreeCost="9.0039" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Column="Expr1017"/><ColumnReference Column="Expr1019"/></OutputList><ComputeScalar><DefinedValues><DefinedValue><ColumnReference Column="Expr1019"/><ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[DiffDays]"><Identifier><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></Identifier></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="31" PhysicalOp="Sequence Project" LogicalOp="Compute Scalar" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.00484832" AvgRowSize="43" EstimatedTotalSubtreeCost="8.99784" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/><ColumnReference Column="Expr1017"/></OutputList><SequenceProject><DefinedValues><DefinedValue><ColumnReference Column="Expr1017"/><ScalarOperator ScalarString="row_number"><Sequence FunctionName="row_number"/></ScalarOperator></DefinedValue></DefinedValues><RelOp NodeId="32" PhysicalOp="Segment" LogicalOp="Segment" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.00121208" AvgRowSize="43" EstimatedTotalSubtreeCost="8.99299" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/><ColumnReference Column="Segment1027"/></OutputList><Segment><GroupBy><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></GroupBy><SegmentColumn><ColumnReference Column="Segment1027"/></SegmentColumn><RelOp NodeId="33" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="60604" EstimateIO="0.0112613" EstimateCPU="4.41946" AvgRowSize="39" EstimatedTotalSubtreeCost="8.99178" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></OutputList><MemoryFractions Input="0.989691" Output="0.989691"/><Sort Distinct="0"><OrderBy><OrderByColumn Ascending="1"><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></OrderByColumn><OrderByColumn Ascending="1"><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/></OrderByColumn></OrderBy><RelOp NodeId="34" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="60604" EstimateIO="4.49424" EstimateCPU="0.0668214" AvgRowSize="39" EstimatedTotalSubtreeCost="4.56106" TableCardinality="60604" Parallel="0" EstimateRebinds="0" EstimateRewinds="0"><OutputList><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></OutputList><TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0"><DefinedValues><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID"/></DefinedValue><DefinedValue><ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays"/></DefinedValue></DefinedValues><Object Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" TableReferenceId="2" IndexKind="Heap"/></TableScan></RelOp></Sort></RelOp></Segment></RelOp></SequenceProject></RelOp></ComputeScalar></RelOp></ComputeScalar></RelOp></Merge></RelOp></ComputeScalar></RelOp></Sort></RelOp></QueryPlan></StmtSimple></Statements></Batch></BatchSequence></ShowPlanXML>
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 15:15:09
Hope this is ok. The graphic part couldn't be copied...
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-16 : 15:22:10
I can't get it to load. Could you click on the showplan hyperlink so that it opens the sqlplan into a new window and then right click anywhere in that new window and select the option to save the execution plan as a .sqlplan file. Then open that file in notepad. CTRL+A to highlight the entire thing and then paste it in this thread.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 15:40:02
<ShowPlanXML xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan" Version="1.1" Build="10.50.6000.34">
<BatchSequence>
<Batch>
<Statements>
<StmtSimple StatementText="#xD;#xA;SELECT Y.DeliverydatePackingSlip, X.ProductionID, X.RessourceID, Y.DiffPromiseDateFirst, P.DiffDaysToBackward, X.ResourceDelay #xD;#xA;from #xD;#xA;(#xD;#xA;SELECT DeliverydatePackingSlip, DiffPromiseDateFirst, Salesid, LineNum, row_number() over(ORDER BY DeliverydatePackingSlip) as ID#xD;#xA;from iq4bisprocess.FactOTDCustomer) Y#xD;#xA;#xD;#xA;inner join iq4bisprocess.FactOTDProduction P on Y.Salesid = P.Salesid and Y.LineNum = P.SalesLineNum #xD;#xA;#xD;#xA;inner join #xD;#xA;#xD;#xA;(SELECT a.ProductionID, a.FinishedDate, a.RessourceID,#xD;#xA;#x9; CASE WHEN a.ord = 1 OR a.DiffDays <= 0 THEN a.DiffDays ELSE a.DiffDays - b.DiffDays END as ResourceDelay#xD;#xA;#xD;#xA;from#xD;#xA;(SELECT FinishedDate, PRODUCTIONID, RessourceID, OperationID,#xD;#xA;#x9; DiffDays, OperationFinished,#xD;#xA;#x9; row_number() over(partition by PRODUCTIONID ORDER BY OPERATIONID) as ord#xD;#xA;from iq4bisprocess.FactOTDRessource)a#xD;#xA;#xD;#xA;left outer join #xD;#xA;#xD;#xA;(SELECT ProductionID, DiffDays, row_number() over(partition by PRODUCTIONID ORDER BY OPERATIONID) as ord #xD;#xA;from iq4bisprocess.FactOTDRessource)b#xD;#xA;on a.ProductionID = b.ProductionID and a.ord = b.ord+1)X#xD;#xA;#xD;#xA;on X.ProductionID = P.ProductionID#xD;#xA;#xD;#xA;WHERE X.RessourceID = '200012' and Y.DeliverydatePackingSlip < DATEADD(day, DATEDIFF(day, 0, getdate()-1), 0) and Y.DeliverydatePackingSlip > DATEADD(day, DATEDIFF(day, 0, getdate()-366), 0)#xD;#xA;#xD;#xA;ORDER by ID DESC#xD;#xA;" StatementId="1" StatementCompId="1" StatementType="SELECT" StatementSubTreeCost="33.6922" StatementEstRows="1.97214" StatementOptmLevel="FULL" QueryHash="0xBA461EF643B8894C" QueryPlanHash="0x3A9D46CED3BC95D2">
<StatementSetOptions QUOTED_IDENTIFIER="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" NUMERIC_ROUNDABORT="false" />
<QueryPlan CachedPlanSize="88" CompileTime="17" CompileCPU="17" CompileMemory="1224">
<MissingIndexes>
<MissingIndexGroup Impact="10.4677">
<MissingIndex Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]">
<ColumnGroup Usage="EQUALITY">
<Column Name="[SalesID]" ColumnId="20" />
<Column Name="[SalesLineNum]" ColumnId="21" />
</ColumnGroup>
<ColumnGroup Usage="INCLUDE">
<Column Name="[ProductionID]" ColumnId="1" />
<Column Name="[DiffDaysToBackward]" ColumnId="113" />
</ColumnGroup>
</MissingIndex>
</MissingIndexGroup>
</MissingIndexes>
<RelOp NodeId="0" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1.97214" EstimateIO="0.0112613" EstimateCPU="0.000103087" AvgRowSize="73" EstimatedTotalSubtreeCost="33.6922" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Column="Expr1021" />
</OutputList>
<MemoryFractions Input="0.00515464" Output="1" />
<Sort Distinct="0">
<OrderBy>
<OrderByColumn Ascending="0">
<ColumnReference Column="Expr1004" />
</OrderByColumn>
</OrderBy>
<RelOp NodeId="1" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="1.97214" EstimateIO="0" EstimateCPU="1.97214e-007" AvgRowSize="73" EstimatedTotalSubtreeCost="33.6808" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Column="Expr1021" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1021" />
<ScalarOperator ScalarString="CASE WHEN [Expr1012]=(1) OR [ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[DiffDays]<=(0) THEN [ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[DiffDays] ELSE [ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[DiffDays]-[Expr1019] END">
<IF>
<Condition>
<ScalarOperator>
<Logical Operation="OR">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1012" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="LE">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(0)" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Condition>
<Then>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</Identifier>
</ScalarOperator>
</Then>
<Else>
<ScalarOperator>
<Arithmetic Operation="SUB">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1019" />
</Identifier>
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Else>
</IF>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="2" PhysicalOp="Merge Join" LogicalOp="Left Outer Join" EstimateRows="1.97214" EstimateIO="0.000475569" EstimateCPU="0.132948" AvgRowSize="86" EstimatedTotalSubtreeCost="33.6808" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
<ColumnReference Column="Expr1012" />
<ColumnReference Column="Expr1019" />
</OutputList>
<Merge ManyToMany="1">
<InnerSideJoinColumns>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Column="Expr1024" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Column="Expr1012" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[ProductionID]=[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[ProductionID] AND [Expr1012]=([Expr1017]+(1))">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1012" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1017" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Residual>
<RelOp NodeId="3" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1.51939" EstimateIO="0.0112613" EstimateCPU="0.000101534" AvgRowSize="104" EstimatedTotalSubtreeCost="24.5374" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
<ColumnReference Column="Expr1012" />
</OutputList>
<MemoryFractions Input="0.00459242" Output="0.00515464" />
<Sort Distinct="0">
<OrderBy>
<OrderByColumn Ascending="1">
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
</OrderByColumn>
<OrderByColumn Ascending="1">
<ColumnReference Column="Expr1012" />
</OrderByColumn>
</OrderBy>
<RelOp NodeId="4" PhysicalOp="Merge Join" LogicalOp="Inner Join" EstimateRows="1.51939" EstimateIO="0.000313" EstimateCPU="0.00567307" AvgRowSize="104" EstimatedTotalSubtreeCost="24.526" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
<ColumnReference Column="Expr1012" />
</OutputList>
<Merge ManyToMany="1">
<InnerSideJoinColumns>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</InnerSideJoinColumns>
<OuterSideJoinColumns>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
</OuterSideJoinColumns>
<Residual>
<ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[ProductionID]=[ES02001_DWH].[iq4bisprocess].[FactOTDProduction].[ProductionID] as [P].[ProductionID]">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Residual>
<RelOp NodeId="5" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1" EstimateIO="0.0112613" EstimateCPU="0.000100055" AvgRowSize="55" EstimatedTotalSubtreeCost="15.4931" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
</OutputList>
<MemoryFractions Input="0.5" Output="0.00459242" />
<Sort Distinct="0">
<OrderBy>
<OrderByColumn Ascending="1">
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
</OrderByColumn>
</OrderBy>
<RelOp NodeId="6" PhysicalOp="Nested Loops" LogicalOp="Inner Join" EstimateRows="1" EstimateIO="0" EstimateCPU="0.130462" AvgRowSize="55" EstimatedTotalSubtreeCost="15.4818" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
</OutputList>
<NestedLoops Optimized="0">
<Predicate>
<ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDCustomer].[SALESID]=[ES02001_DWH].[iq4bisprocess].[FactOTDProduction].[SalesID] as [P].[SalesID] AND [ES02001_DWH].[iq4bisprocess].[FactOTDCustomer].[linenum]=[ES02001_DWH].[iq4bisprocess].[FactOTDProduction].[SalesLineNum] as [P].[SalesLineNum]">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesID" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesLineNum" />
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
<RelOp NodeId="7" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="1" EstimateIO="0.0112613" EstimateCPU="0.00010006" AvgRowSize="60" EstimatedTotalSubtreeCost="11.9511" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
</OutputList>
<MemoryFractions Input="0.0027972" Output="0.5" />
<Sort Distinct="0">
<OrderBy>
<OrderByColumn Ascending="0">
<ColumnReference Column="Expr1004" />
</OrderByColumn>
</OrderBy>
<RelOp NodeId="8" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="1" EstimateIO="0" EstimateCPU="0.0891651" AvgRowSize="60" EstimatedTotalSubtreeCost="11.9397" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
</OutputList>
<Filter StartupExpression="0">
<RelOp NodeId="9" PhysicalOp="Sequence Project" LogicalOp="Compute Scalar" EstimateRows="101324" EstimateIO="0" EstimateCPU="0.00810592" AvgRowSize="60" EstimatedTotalSubtreeCost="11.8506" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Expr1004" />
</OutputList>
<SequenceProject>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1004" />
<ScalarOperator ScalarString="row_number">
<Sequence FunctionName="row_number" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="10" PhysicalOp="Segment" LogicalOp="Segment" EstimateRows="101324" EstimateIO="0" EstimateCPU="0.00202648" AvgRowSize="60" EstimatedTotalSubtreeCost="11.8425" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
<ColumnReference Column="Segment1025" />
</OutputList>
<Segment>
<GroupBy />
<SegmentColumn>
<ColumnReference Column="Segment1025" />
</SegmentColumn>
<RelOp NodeId="11" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="101324" EstimateIO="0.0112613" EstimateCPU="7.73369" AvgRowSize="52" EstimatedTotalSubtreeCost="11.8404" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
</OutputList>
<MemoryFractions Input="1" Output="0.997203" />
<Sort Distinct="0">
<OrderBy>
<OrderByColumn Ascending="1">
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
</OrderByColumn>
</OrderBy>
<RelOp NodeId="12" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="101324" EstimateIO="3.98394" EstimateCPU="0.111535" AvgRowSize="52" EstimatedTotalSubtreeCost="4.09548" TableCardinality="101324" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
</OutputList>
<TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="SALESID" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="linenum" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DiffPromiseDateFirst" />
</DefinedValue>
</DefinedValues>
<Object Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" IndexKind="Heap" />
</TableScan>
</RelOp>
</Sort>
</RelOp>
</Segment>
</RelOp>
</SequenceProject>
</RelOp>
<Predicate>
<ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDCustomer].[DeliverydatePackingSlip]<dateadd(day,datediff(day,'1900-01-01 00:00:00.000',getdate()-'1900-01-02 00:00:00.000'),'1900-01-01 00:00:00.000') AND [ES02001_DWH].[iq4bisprocess].[FactOTDCustomer].[DeliverydatePackingSlip]>dateadd(day,datediff(day,'1900-01-01 00:00:00.000',getdate()-'1901-01-02 00:00:00.000'),'1900-01-01 00:00:00.000')">
<Logical Operation="AND">
<ScalarOperator>
<Compare CompareOp="LT">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="ConstExpr1022">
<ScalarOperator>
<Intrinsic FunctionName="dateadd">
<ScalarOperator>
<Const ConstValue="(4)" />
</ScalarOperator>
<ScalarOperator>
<Intrinsic FunctionName="datediff">
<ScalarOperator>
<Const ConstValue="(4)" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'1900-01-01 00:00:00.000'" />
</ScalarOperator>
<ScalarOperator>
<Arithmetic Operation="SUB">
<ScalarOperator>
<Intrinsic FunctionName="getdate" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'1900-01-02 00:00:00.000'" />
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'1900-01-01 00:00:00.000'" />
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</ColumnReference>
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
<ScalarOperator>
<Compare CompareOp="GT">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDCustomer]" Column="DeliverydatePackingSlip" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Identifier>
<ColumnReference Column="ConstExpr1023">
<ScalarOperator>
<Intrinsic FunctionName="dateadd">
<ScalarOperator>
<Const ConstValue="(4)" />
</ScalarOperator>
<ScalarOperator>
<Intrinsic FunctionName="datediff">
<ScalarOperator>
<Const ConstValue="(4)" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'1900-01-01 00:00:00.000'" />
</ScalarOperator>
<ScalarOperator>
<Arithmetic Operation="SUB">
<ScalarOperator>
<Intrinsic FunctionName="getdate" />
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'1901-01-02 00:00:00.000'" />
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="'1900-01-01 00:00:00.000'" />
</ScalarOperator>
</Intrinsic>
</ScalarOperator>
</ColumnReference>
</Identifier>
</ScalarOperator>
</Compare>
</ScalarOperator>
</Logical>
</ScalarOperator>
</Predicate>
</Filter>
</RelOp>
</Sort>
</RelOp>
<RelOp NodeId="17" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="31211" EstimateIO="3.34387" EstimateCPU="0.0344891" AvgRowSize="74" EstimatedTotalSubtreeCost="3.37835" TableCardinality="31211" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesLineNum" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
</OutputList>
<TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="ProductionID" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesID" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="SalesLineNum" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" Column="DiffDaysToBackward" />
</DefinedValue>
</DefinedValues>
<Object Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDProduction]" Alias="[P]" IndexKind="Heap" />
</TableScan>
</RelOp>
</NestedLoops>
</RelOp>
</Sort>
</RelOp>
<RelOp NodeId="19" PhysicalOp="Filter" LogicalOp="Filter" EstimateRows="13771.5" EstimateIO="0" EstimateCPU="0.0290899" AvgRowSize="57" EstimatedTotalSubtreeCost="9.02693" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
<ColumnReference Column="Expr1012" />
</OutputList>
<Filter StartupExpression="0">
<RelOp NodeId="20" PhysicalOp="Sequence Project" LogicalOp="Compute Scalar" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.00484832" AvgRowSize="57" EstimatedTotalSubtreeCost="8.99784" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
<ColumnReference Column="Expr1012" />
</OutputList>
<SequenceProject>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1012" />
<ScalarOperator ScalarString="row_number">
<Sequence FunctionName="row_number" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="21" PhysicalOp="Segment" LogicalOp="Segment" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.00121208" AvgRowSize="57" EstimatedTotalSubtreeCost="8.99299" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
<ColumnReference Column="Segment1026" />
</OutputList>
<Segment>
<GroupBy>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</GroupBy>
<SegmentColumn>
<ColumnReference Column="Segment1026" />
</SegmentColumn>
<RelOp NodeId="22" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="60604" EstimateIO="0.0112613" EstimateCPU="4.41946" AvgRowSize="53" EstimatedTotalSubtreeCost="8.99178" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</OutputList>
<MemoryFractions Input="0.990815" Output="0.990815" />
<Sort Distinct="0">
<OrderBy>
<OrderByColumn Ascending="1">
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</OrderByColumn>
<OrderByColumn Ascending="1">
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
</OrderByColumn>
</OrderBy>
<RelOp NodeId="23" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="60604" EstimateIO="4.49424" EstimateCPU="0.0668214" AvgRowSize="53" EstimatedTotalSubtreeCost="4.56106" TableCardinality="60604" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</OutputList>
<TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</DefinedValue>
</DefinedValues>
<Object Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" TableReferenceId="1" IndexKind="Heap" />
</TableScan>
</RelOp>
</Sort>
</RelOp>
</Segment>
</RelOp>
</SequenceProject>
</RelOp>
<Predicate>
<ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[RessourceID]=N'200012'">
<Compare CompareOp="EQ">
<ScalarOperator>
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="RessourceID" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="N'200012'" />
</ScalarOperator>
</Compare>
</ScalarOperator>
</Predicate>
</Filter>
</RelOp>
</Merge>
</RelOp>
</Sort>
</RelOp>
<RelOp NodeId="29" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.0060604" AvgRowSize="51" EstimatedTotalSubtreeCost="9.00996" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Column="Expr1017" />
<ColumnReference Column="Expr1019" />
<ColumnReference Column="Expr1024" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1024" />
<ScalarOperator ScalarString="[Expr1017]+(1)">
<Arithmetic Operation="ADD">
<ScalarOperator>
<Identifier>
<ColumnReference Column="Expr1017" />
</Identifier>
</ScalarOperator>
<ScalarOperator>
<Const ConstValue="(1)" />
</ScalarOperator>
</Arithmetic>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="30" PhysicalOp="Compute Scalar" LogicalOp="Compute Scalar" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.0060604" AvgRowSize="43" EstimatedTotalSubtreeCost="9.0039" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Column="Expr1017" />
<ColumnReference Column="Expr1019" />
</OutputList>
<ComputeScalar>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1019" />
<ScalarOperator ScalarString="[ES02001_DWH].[iq4bisprocess].[FactOTDRessource].[DiffDays]">
<Identifier>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</Identifier>
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="31" PhysicalOp="Sequence Project" LogicalOp="Compute Scalar" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.00484832" AvgRowSize="43" EstimatedTotalSubtreeCost="8.99784" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
<ColumnReference Column="Expr1017" />
</OutputList>
<SequenceProject>
<DefinedValues>
<DefinedValue>
<ColumnReference Column="Expr1017" />
<ScalarOperator ScalarString="row_number">
<Sequence FunctionName="row_number" />
</ScalarOperator>
</DefinedValue>
</DefinedValues>
<RelOp NodeId="32" PhysicalOp="Segment" LogicalOp="Segment" EstimateRows="60604" EstimateIO="0" EstimateCPU="0.00121208" AvgRowSize="43" EstimatedTotalSubtreeCost="8.99299" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
<ColumnReference Column="Segment1027" />
</OutputList>
<Segment>
<GroupBy>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</GroupBy>
<SegmentColumn>
<ColumnReference Column="Segment1027" />
</SegmentColumn>
<RelOp NodeId="33" PhysicalOp="Sort" LogicalOp="Sort" EstimateRows="60604" EstimateIO="0.0112613" EstimateCPU="4.41946" AvgRowSize="39" EstimatedTotalSubtreeCost="8.99178" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</OutputList>
<MemoryFractions Input="0.989691" Output="0.989691" />
<Sort Distinct="0">
<OrderBy>
<OrderByColumn Ascending="1">
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</OrderByColumn>
<OrderByColumn Ascending="1">
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
</OrderByColumn>
</OrderBy>
<RelOp NodeId="34" PhysicalOp="Table Scan" LogicalOp="Table Scan" EstimateRows="60604" EstimateIO="4.49424" EstimateCPU="0.0668214" AvgRowSize="39" EstimatedTotalSubtreeCost="4.56106" TableCardinality="60604" Parallel="0" EstimateRebinds="0" EstimateRewinds="0">
<OutputList>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</OutputList>
<TableScan Ordered="0" ForcedIndex="0" ForceScan="0" NoExpandHint="0">
<DefinedValues>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="ProductionID" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="OperationID" />
</DefinedValue>
<DefinedValue>
<ColumnReference Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" Column="DiffDays" />
</DefinedValue>
</DefinedValues>
<Object Database="[ES02001_DWH]" Schema="[iq4bisprocess]" Table="[FactOTDRessource]" TableReferenceId="2" IndexKind="Heap" />
</TableScan>
</RelOp>
</Sort>
</RelOp>
</Segment>
</RelOp>
</SequenceProject>
</RelOp>
</ComputeScalar>
</RelOp>
</ComputeScalar>
</RelOp>
</Merge>
</RelOp>
</ComputeScalar>
</RelOp>
</Sort>
</RelOp>
</QueryPlan>
</StmtSimple>
</Statements>
</Batch>
</BatchSequence>
</ShowPlanXML>
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 15:40:35
Thank you for the patience :)
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-16 : 16:42:32
Unfortunately I still can't open it. Let's do this another way. Run this:

SET STATISTICS IO ON;
YourQueryGoesHere

Run it and post the statistics output. We don't need to see the data, just the stats output. This will tell you which tables need the most focus first.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 17:35:02
Tara, hmmmm... I ran the command you posted, a hyperlink is returned, I click on it and in a new window divided into 4 sections I see:
TOP:
Query 1: Query cost (relative to the batch): 0%
SET STATISTICS IO ON;

then in the section underneath I see a green Icon (T-SQL) and below it says: SET STATS Cost:0 %

Then Section 3 & 4 are as the same as I got in the first place with the "SET SHOWPLAN_XML ON; GO"
Some text and the graphical depiction of the query.

Stats output? No idea where these should appear
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-16 : 17:40:36
Please open a new window and run it there, add SET STATISTICS TIME ON.

SET STATISTICS IO ON;
SET STATISTICS TIME ON;

YourQueryGoesHere

Run it.

What I want to see is the output that is similar to this, though yours will be much longer:


SQL Server parse and compile time:
CPU time = 2 ms, elapsed time = 2 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 1 ms.
Table 'table1'. Scan count 10, logical reads 50473, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

SQL Server Execution Times:
CPU time = 1793 ms, elapsed time = 450 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 0 ms.

SQL Server Execution Times:
CPU time = 0 ms, elapsed time = 1 ms.


Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-16 : 18:30:50
With the 2 lines ahead the query gets just executed... 10 minutes and then the well known results of the query. No stat at all!? Do you need special rights to do so?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2015-02-16 : 18:41:50
No special rights are required. If you have access to run the query, then you have access to the stats. Are you checking all of the tabs though? It'll likely be in a different tab than the results.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-17 : 02:30:08
You were right, it was displayed in the Messages Tab:

(4680 row(s) affected)
Table 'Worktable'. Scan count 33, logical reads 265, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'FactOTDRessource'. Scan count 2, logical reads 12128, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'FactOTDProduction'. Scan count 1, logical reads 169049725, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'FactOTDCustomer'. Scan count 1, logical reads 5375, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

SQL Server Execution Times:
CPU time = 638965 ms, elapsed time = 669742 ms.
Go to Top of Page

barnabeck
Posting Yak Master

236 Posts

Posted - 2015-02-18 : 06:01:51
Everything solved now! I had reported these comments on Indexation together with an example that proved the behavior on runtime to the guys that are doing the cubes and they fixed it!
Thank you for the great support!
Go to Top of Page
    Next Page

- Advertisement -