Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
163
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="utf-16"?>
  2. <ShowPlanXML xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Version="1.3.1" Build="12.0.5000.0" xmlns="http://schemas.microsoft.com/sqlserver/2004/07/showplan">
  3. <BatchSequence>
  4. <Batch>
  5. <Statements>
  6. <StmtSimple StatementCompId="1" StatementEstRows="14.0752" StatementId="1" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="70" StatementSubTreeCost="0.353911" StatementText="select * from(select *,ROW_NUMBER() OVER (PARTITION BY itemid ORDER BY origdate desc)as RowNum&#xD;&#xA;FROM Items)t1&#xD;&#xA;&#xD;&#xA; where OrigDate &lt; getdate() and OrigHand=930" StatementType="SELECT" QueryHash="0x6F49AEB9EC2AA699" QueryPlanHash="0xD170B08F2C150C2F" RetrievedFromCache="true">
  7. <StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
  8. <QueryPlan DegreeOfParallelism="1" CachedPlanSize="32" CompileTime="1" CompileCPU="1" CompileMemory="272">
  9. <MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" />
  10. <OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="64000" EstimatedPagesCached="32000" EstimatedAvailableDegreeOfParallelism="4" MaxCompileMemory="2265520" />
  11. <RelOp AvgRowSize="482" EstimateCPU="0.034269" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="14.0752" LogicalOp="Filter" NodeId="0" Parallel="false" PhysicalOp="Filter" EstimatedTotalSubtreeCost="0.353911">
  12. <OutputList>
  13. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  14. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  15. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  16. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  17. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  18. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  19. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  20. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  21. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  22. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  23. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  24. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  25. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  26. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  27. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  28. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  29. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  30. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  31. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  32. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  33. <ColumnReference Column="Expr1002" />
  34. </OutputList>
  35. <RunTimeInformation>
  36. <RunTimeCountersPerThread Thread="0" ActualRows="14" ActualEndOfScans="1" ActualExecutions="1" ActualElapsedms="20" ActualCPUms="20" />
  37. </RunTimeInformation>
  38. <Filter StartupExpression="false">
  39. <RelOp AvgRowSize="482" EstimateCPU="0.00311536" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="38942" LogicalOp="Compute Scalar" NodeId="1" Parallel="false" PhysicalOp="Sequence Project" EstimatedTotalSubtreeCost="0.319642">
  40. <OutputList>
  41. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  42. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  43. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  44. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  45. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  46. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  47. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  48. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  49. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  50. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  51. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  52. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  53. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  54. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  55. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  56. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  57. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  58. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  59. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  60. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  61. <ColumnReference Column="Expr1002" />
  62. </OutputList>
  63. <RunTimeInformation>
  64. <RunTimeCountersPerThread Thread="0" ActualRows="38942" ActualEndOfScans="1" ActualExecutions="1" ActualElapsedms="17" ActualCPUms="17" />
  65. </RunTimeInformation>
  66. <SequenceProject>
  67. <DefinedValues>
  68. <DefinedValue>
  69. <ColumnReference Column="Expr1002" />
  70. <ScalarOperator ScalarString="row_number">
  71. <Sequence FunctionName="row_number" />
  72. </ScalarOperator>
  73. </DefinedValue>
  74. </DefinedValues>
  75. <RelOp AvgRowSize="482" EstimateCPU="0.00077884" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="38942" LogicalOp="Segment" NodeId="2" Parallel="false" PhysicalOp="Segment" EstimatedTotalSubtreeCost="0.316527">
  76. <OutputList>
  77. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  78. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  79. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  80. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  81. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  82. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  83. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  84. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  85. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  86. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  87. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  88. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  89. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  90. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  91. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  92. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  93. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  94. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  95. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  96. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  97. <ColumnReference Column="Segment1004" />
  98. </OutputList>
  99. <RunTimeInformation>
  100. <RunTimeCountersPerThread Thread="0" ActualRows="38942" ActualEndOfScans="1" ActualExecutions="1" ActualElapsedms="9" ActualCPUms="9" />
  101. </RunTimeInformation>
  102. <Segment>
  103. <GroupBy>
  104. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  105. </GroupBy>
  106. <SegmentColumn>
  107. <ColumnReference Column="Segment1004" />
  108. </SegmentColumn>
  109. <RelOp AvgRowSize="474" EstimateCPU="0.0429932" EstimateIO="0.272755" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="38942" LogicalOp="Clustered Index Scan" NodeId="3" Parallel="false" PhysicalOp="Clustered Index Scan" EstimatedTotalSubtreeCost="0.315748" TableCardinality="38942">
  110. <OutputList>
  111. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  112. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  113. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  114. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  115. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  116. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  117. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  118. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  119. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  120. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  121. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  122. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  123. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  124. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  125. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  126. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  127. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  128. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  129. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  130. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  131. </OutputList>
  132. <RunTimeInformation>
  133. <RunTimeCountersPerThread Thread="0" ActualRows="38942" ActualRowsRead="38942" ActualEndOfScans="1" ActualExecutions="1" ActualElapsedms="4" ActualCPUms="4" ActualScans="1" ActualLogicalReads="367" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
  134. </RunTimeInformation>
  135. <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  136. <DefinedValues>
  137. <DefinedValue>
  138. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  139. </DefinedValue>
  140. <DefinedValue>
  141. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  142. </DefinedValue>
  143. <DefinedValue>
  144. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  145. </DefinedValue>
  146. <DefinedValue>
  147. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  148. </DefinedValue>
  149. <DefinedValue>
  150. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  151. </DefinedValue>
  152. <DefinedValue>
  153. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  154. </DefinedValue>
  155. <DefinedValue>
  156. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  157. </DefinedValue>
  158. <DefinedValue>
  159. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  160. </DefinedValue>
  161. <DefinedValue>
  162. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  163. </DefinedValue>
  164. <DefinedValue>
  165. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  166. </DefinedValue>
  167. <DefinedValue>
  168. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  169. </DefinedValue>
  170. <DefinedValue>
  171. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  172. </DefinedValue>
  173. <DefinedValue>
  174. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  175. </DefinedValue>
  176. <DefinedValue>
  177. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  178. </DefinedValue>
  179. <DefinedValue>
  180. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  181. </DefinedValue>
  182. <DefinedValue>
  183. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  184. </DefinedValue>
  185. <DefinedValue>
  186. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  187. </DefinedValue>
  188. <DefinedValue>
  189. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  190. </DefinedValue>
  191. <DefinedValue>
  192. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  193. </DefinedValue>
  194. <DefinedValue>
  195. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  196. </DefinedValue>
  197. </DefinedValues>
  198. <Object Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Index="[PK_Items]" IndexKind="Clustered" Storage="RowStore" />
  199. </IndexScan>
  200. </RelOp>
  201. </Segment>
  202. </RelOp>
  203. </SequenceProject>
  204. </RelOp>
  205. <Predicate>
  206. <ScalarOperator ScalarString="[MyDatabase].[dbo].[Items].[OrigDate]&lt;getdate() AND [MyDatabase].[dbo].[Items].[OrigHand]=(930)">
  207. <Logical Operation="AND">
  208. <ScalarOperator>
  209. <Compare CompareOp="LT">
  210. <ScalarOperator>
  211. <Identifier>
  212. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  213. </Identifier>
  214. </ScalarOperator>
  215. <ScalarOperator>
  216. <Identifier>
  217. <ColumnReference Column="ConstExpr1003">
  218. <ScalarOperator>
  219. <Intrinsic FunctionName="getdate" />
  220. </ScalarOperator>
  221. </ColumnReference>
  222. </Identifier>
  223. </ScalarOperator>
  224. </Compare>
  225. </ScalarOperator>
  226. <ScalarOperator>
  227. <Compare CompareOp="EQ">
  228. <ScalarOperator>
  229. <Identifier>
  230. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  231. </Identifier>
  232. </ScalarOperator>
  233. <ScalarOperator>
  234. <Const ConstValue="(930)" />
  235. </ScalarOperator>
  236. </Compare>
  237. </ScalarOperator>
  238. </Logical>
  239. </ScalarOperator>
  240. </Predicate>
  241. </Filter>
  242. </RelOp>
  243. </QueryPlan>
  244. </StmtSimple>
  245. </Statements>
  246. </Batch>
  247. <Batch>
  248. <Statements>
  249. <StmtSimple StatementCompId="2" StatementEstRows="14.0752" StatementId="2" StatementOptmLevel="FULL" StatementOptmEarlyAbortReason="GoodEnoughPlanFound" CardinalityEstimationModelVersion="70" StatementSubTreeCost="0.0457806" StatementText="select *,ROW_NUMBER() OVER (PARTITION BY itemid ORDER BY origdate desc)as RowNum&#xD;&#xA;FROM Items&#xD;&#xA;&#xD;&#xA; where OrigDate &lt; getdate() and OrigHand=930" StatementType="SELECT" QueryHash="0xEF837A21385827F9" QueryPlanHash="0x94D0B3BCDAA162F9" RetrievedFromCache="true">
  250. <StatementSetOptions ANSI_NULLS="true" ANSI_PADDING="true" ANSI_WARNINGS="true" ARITHABORT="true" CONCAT_NULL_YIELDS_NULL="true" NUMERIC_ROUNDABORT="false" QUOTED_IDENTIFIER="true" />
  251. <QueryPlan DegreeOfParallelism="1" CachedPlanSize="48" CompileTime="1" CompileCPU="1" CompileMemory="352">
  252. <MemoryGrantInfo SerialRequiredMemory="0" SerialDesiredMemory="0" />
  253. <OptimizerHardwareDependentProperties EstimatedAvailableMemoryGrant="64000" EstimatedPagesCached="32000" EstimatedAvailableDegreeOfParallelism="4" MaxCompileMemory="2265520" />
  254. <RelOp AvgRowSize="482" EstimateCPU="1.12601E-06" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="14.0752" LogicalOp="Compute Scalar" NodeId="0" Parallel="false" PhysicalOp="Sequence Project" EstimatedTotalSubtreeCost="0.0457806">
  255. <OutputList>
  256. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  257. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  258. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  259. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  260. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  261. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  262. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  263. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  264. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  265. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  266. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  267. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  268. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  269. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  270. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  271. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  272. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  273. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  274. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  275. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  276. <ColumnReference Column="Expr1002" />
  277. </OutputList>
  278. <RunTimeInformation>
  279. <RunTimeCountersPerThread Thread="0" ActualRows="14" ActualEndOfScans="1" ActualExecutions="1" ActualElapsedms="0" ActualCPUms="0" />
  280. </RunTimeInformation>
  281. <SequenceProject>
  282. <DefinedValues>
  283. <DefinedValue>
  284. <ColumnReference Column="Expr1002" />
  285. <ScalarOperator ScalarString="row_number">
  286. <Sequence FunctionName="row_number" />
  287. </ScalarOperator>
  288. </DefinedValue>
  289. </DefinedValues>
  290. <RelOp AvgRowSize="482" EstimateCPU="2.81504E-07" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="14.0752" LogicalOp="Segment" NodeId="1" Parallel="false" PhysicalOp="Segment" EstimatedTotalSubtreeCost="0.0457741">
  291. <OutputList>
  292. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  293. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  294. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  295. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  296. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  297. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  298. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  299. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  300. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  301. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  302. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  303. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  304. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  305. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  306. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  307. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  308. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  309. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  310. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  311. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  312. <ColumnReference Column="Segment1004" />
  313. </OutputList>
  314. <RunTimeInformation>
  315. <RunTimeCountersPerThread Thread="0" ActualRows="14" ActualEndOfScans="1" ActualExecutions="1" ActualElapsedms="0" ActualCPUms="0" />
  316. </RunTimeInformation>
  317. <Segment>
  318. <GroupBy>
  319. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  320. </GroupBy>
  321. <SegmentColumn>
  322. <ColumnReference Column="Segment1004" />
  323. </SegmentColumn>
  324. <RelOp AvgRowSize="474" EstimateCPU="5.88343E-05" EstimateIO="0" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="14.0752" LogicalOp="Inner Join" NodeId="2" Parallel="false" PhysicalOp="Nested Loops" EstimatedTotalSubtreeCost="0.0457724">
  325. <OutputList>
  326. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  327. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  328. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  329. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  330. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  331. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  332. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  333. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  334. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  335. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  336. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  337. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  338. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  339. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  340. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  341. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  342. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  343. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  344. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  345. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  346. </OutputList>
  347. <RunTimeInformation>
  348. <RunTimeCountersPerThread Thread="0" ActualRows="14" ActualEndOfScans="1" ActualExecutions="1" ActualElapsedms="0" ActualCPUms="0" />
  349. </RunTimeInformation>
  350. <NestedLoops Optimized="false">
  351. <OuterReferences>
  352. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  353. </OuterReferences>
  354. <RelOp AvgRowSize="15" EstimateCPU="0.000172483" EstimateIO="0.003125" EstimateRebinds="0" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="14.0752" LogicalOp="Index Seek" NodeId="3" Parallel="false" PhysicalOp="Index Seek" EstimatedTotalSubtreeCost="0.00329748" TableCardinality="38942">
  355. <OutputList>
  356. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  357. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  358. </OutputList>
  359. <RunTimeInformation>
  360. <RunTimeCountersPerThread Thread="0" ActualRows="14" ActualRowsRead="14" ActualEndOfScans="1" ActualExecutions="1" ActualElapsedms="0" ActualCPUms="0" ActualScans="1" ActualLogicalReads="2" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
  361. </RunTimeInformation>
  362. <IndexScan Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  363. <DefinedValues>
  364. <DefinedValue>
  365. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  366. </DefinedValue>
  367. <DefinedValue>
  368. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  369. </DefinedValue>
  370. </DefinedValues>
  371. <Object Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Index="[IX_Items_5]" IndexKind="NonClustered" Storage="RowStore" />
  372. <SeekPredicates>
  373. <SeekPredicateNew>
  374. <SeekKeys>
  375. <Prefix ScanType="EQ">
  376. <RangeColumns>
  377. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigHand" />
  378. </RangeColumns>
  379. <RangeExpressions>
  380. <ScalarOperator ScalarString="(930)">
  381. <Const ConstValue="(930)" />
  382. </ScalarOperator>
  383. </RangeExpressions>
  384. </Prefix>
  385. </SeekKeys>
  386. </SeekPredicateNew>
  387. </SeekPredicates>
  388. </IndexScan>
  389. </RelOp>
  390. <RelOp AvgRowSize="466" EstimateCPU="0.0001581" EstimateIO="0.003125" EstimateRebinds="13.0752" EstimateRewinds="0" EstimatedExecutionMode="Row" EstimateRows="14.0752" LogicalOp="Clustered Index Seek" NodeId="5" Parallel="false" PhysicalOp="Clustered Index Seek" EstimatedTotalSubtreeCost="0.0424161" TableCardinality="38942">
  391. <OutputList>
  392. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  393. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  394. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  395. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  396. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  397. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  398. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  399. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  400. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  401. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  402. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  403. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  404. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  405. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  406. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  407. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  408. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  409. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  410. </OutputList>
  411. <RunTimeInformation>
  412. <RunTimeCountersPerThread Thread="0" ActualRows="14" ActualRowsRead="14" ActualEndOfScans="0" ActualExecutions="14" ActualElapsedms="0" ActualCPUms="0" ActualScans="0" ActualLogicalReads="28" ActualPhysicalReads="0" ActualReadAheads="0" ActualLobLogicalReads="0" ActualLobPhysicalReads="0" ActualLobReadAheads="0" />
  413. </RunTimeInformation>
  414. <IndexScan Lookup="true" Ordered="true" ScanDirection="FORWARD" ForcedIndex="false" ForceSeek="false" ForceScan="false" NoExpandHint="false" Storage="RowStore">
  415. <DefinedValues>
  416. <DefinedValue>
  417. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedOn" />
  418. </DefinedValue>
  419. <DefinedValue>
  420. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="AddedBy" />
  421. </DefinedValue>
  422. <DefinedValue>
  423. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ProductID" />
  424. </DefinedValue>
  425. <DefinedValue>
  426. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  427. </DefinedValue>
  428. <DefinedValue>
  429. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="SerialCode" />
  430. </DefinedValue>
  431. <DefinedValue>
  432. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Comment" />
  433. </DefinedValue>
  434. <DefinedValue>
  435. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="Active" />
  436. </DefinedValue>
  437. <DefinedValue>
  438. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LicenseCode" />
  439. </DefinedValue>
  440. <DefinedValue>
  441. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="RedCode" />
  442. </DefinedValue>
  443. <DefinedValue>
  444. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="InternalCode" />
  445. </DefinedValue>
  446. <DefinedValue>
  447. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigStorageID" />
  448. </DefinedValue>
  449. <DefinedValue>
  450. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="PurchaseItemID" />
  451. </DefinedValue>
  452. <DefinedValue>
  453. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="LetLacking" />
  454. </DefinedValue>
  455. <DefinedValue>
  456. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="TrackStorage" />
  457. </DefinedValue>
  458. <DefinedValue>
  459. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ForRemove" />
  460. </DefinedValue>
  461. <DefinedValue>
  462. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="BrandSuit" />
  463. </DefinedValue>
  464. <DefinedValue>
  465. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OldCodes" />
  466. </DefinedValue>
  467. <DefinedValue>
  468. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ReleaseGroup" />
  469. </DefinedValue>
  470. </DefinedValues>
  471. <Object Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Index="[PK_Items]" TableReferenceId="-1" IndexKind="Clustered" Storage="RowStore" />
  472. <SeekPredicates>
  473. <SeekPredicateNew>
  474. <SeekKeys>
  475. <Prefix ScanType="EQ">
  476. <RangeColumns>
  477. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  478. </RangeColumns>
  479. <RangeExpressions>
  480. <ScalarOperator ScalarString="[MyDatabase].[dbo].[Items].[ItemID]">
  481. <Identifier>
  482. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="ItemID" />
  483. </Identifier>
  484. </ScalarOperator>
  485. </RangeExpressions>
  486. </Prefix>
  487. </SeekKeys>
  488. </SeekPredicateNew>
  489. </SeekPredicates>
  490. <Predicate>
  491. <ScalarOperator ScalarString="[MyDatabase].[dbo].[Items].[OrigDate]&lt;getdate()">
  492. <Compare CompareOp="LT">
  493. <ScalarOperator>
  494. <Identifier>
  495. <ColumnReference Database="[MyDatabase]" Schema="[dbo]" Table="[Items]" Column="OrigDate" />
  496. </Identifier>
  497. </ScalarOperator>
  498. <ScalarOperator>
  499. <Identifier>
  500. <ColumnReference Column="ConstExpr1003">
  501. <ScalarOperator>
  502. <Intrinsic FunctionName="getdate" />
  503. </ScalarOperator>
  504. </ColumnReference>
  505. </Identifier>
  506. </ScalarOperator>
  507. </Compare>
  508. </ScalarOperator>
  509. </Predicate>
  510. </IndexScan>
  511. </RelOp>
  512. </NestedLoops>
  513. </RelOp>
  514. </Segment>
  515. </RelOp>
  516. </SequenceProject>
  517. </RelOp>
  518. </QueryPlan>
  519. </StmtSimple>
  520. </Statements>
  521. </Batch>
  522. </BatchSequence>
  523. </ShowPlanXML>
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement