Hello
I was wondering why it sums up all the quantity in ILE, instead of summing Remaining quantity.
Wouldn't it be faster, especially since in 5 SP1 they will use indexed views?
The flow field should do a lookup on remaining qty where it's open for that item.
my 2 cents
0
Comments
Basing the sum on Quantity only requires that the SumIndex (or indexed view) be updated on insert of new entries. Moving the sum to "Remaining Amount" would also require the SumIndex (or indexed view) to be updated on record modify (item applications).
Indexed views do not come at no cost. They are real tables stored on the disk and must be updated when the underlying tables are changed. There is a trade-off between the faster access of the indexed view and the additional writes required.
Granted Inserts will have the same cost, but the real benefit will be Reads.
Cause You'll only look at a tiny set of open ILE. Not millions.
Also they should create a separate file group if that's possible for those indexed views.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Yes, inserts will have the same cost, but your approach would add the cost for modifies.
Do a query for an item that is open on sql and see the execution plan.
Modifcation will have a cost, but the read will be much faster. That’s the whole Point of SIFT.
Anyways your issues do not matter because the remaining quantity has a SumIndexfield, hence a indexed view.
All I’m suggesting use one view instead of another.
Open is flaged to false once remaining qty is set to zero.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
That's an assumption. You will probably get those results where there is a very small percentage of open entries. But what about the system where there is a large number of open entries.
Also the SumIndexFields should be covering fields in the indexes, so that no lookup to the clustered index is done.
In the two scenarios, in first you are reading all the records for a given item. In second scenario you are reading a subset. No matter how the records are in the db the subset will always be faster.
This discussion is somewhat irrelevant in the context of an indexed view. The indexed view stores the result set of the view and not the individual source records. So whether the sum was on quantity or Remaining Quantity the result is the same. Your approach may improve normal view queries (in most cases) but it would have no impact on an indexed view.