Improve Storage Settlement Performance

Issue No: IC-9857
Created 10/17/2021 10:42:17 PM
Type Bug-QC
Priority Blocker
Status Closed
Resolution Fixed
Fixed Version 21.2
Description *This issue relates to i21 Help Desk ticket:* [ HDTN-263197 - SLOW|https://helpdesk.irely.com/iRelyi21live/#/HD/Ticket/?ticket=HDTN-263197]   *Issue* :   Email from the customer:   "All steps within the system have a lag time and we spend a lot of time watching the system try to load the screens. In addition, I've had to clear my cache and do a hard reboot anywhere from 5 to 15 times a day to break the cycle and get it to load what we need. If I am working in the settlement process, it often has to be redone after each settlement to get the next screen to pull in the selected storage records. I haven't noticed any improvement in functionality." Another bottleneck that's taking the most time during storage settlement is the repeated calls to *uspICReduceStockInFIFOStorage* in *uspICPostFIFOStorage* .   As per checking with sir Feb, the number of calls to uspICReduceStockInFIFOStorage is relative to the number of FIFO buckets.   !pastedImage_d171913_0.jpg!     I tried to post a settlement with 10 storage tickets and 50,000 Bushels and captured the execution plans for it.   As we can see in the stats below, the query inside uspICReduceStockInFIFOStorage was executed *335* times with an average execution time of *29ms* , contributing a total of *9.597 seconds* of wait time to the settlement transaction.   !pastedImage_d171913_1.jpg!     Currently, the average execution time of a settlement with 10 storage tickets and 50,000 bushels is around 19 seconds in my local environment.   !pastedImage_d171913_2.jpg!     *Acceptance* : Improve the overall performance of the settlement process