iRely: HDTN-234537 - Direct Ship Process (Performance Testing) - Missing index in tblARInvoiceDetail

Issue No: AR-13873
Created 10/11/2021 9:30:45 AM
Type Bug-QC
Priority Critical
Status Closed
Resolution Fixed
Fixed Version 20.1
Description *This issue relates to i21 Help Desk ticket:* [ HDTN-299583 - Upgrade Production to 22.1.|https://helpdesk.irely.com/iRelyi21live/#/HD/Ticket/?ticket=HDTN-299583]   This issue relates to i21 Help Desk ticket. Click the link below to go to Help Desk ticket.   [HDTN-234537 - Direct Ship Process|https://helpdesk.irely.com/iRelyi21live//#/HD/Ticket/?ticket=HDTN-234537]     *Steps* :   * Create a Direct In ticket with Spot Distribution * Distribute ticket * Undistribute the Direct In ticket   *Issue:* Undistributing a ticket takes long to finish   As checked in the execution plan for ticket undistribution, it seems that an index scan against *tblARInvoiceDetail* takes the longest execution with a large number of reads.   !pastedImage_d171544_0.jpg!   Adding the following index greatly improves the performance:   {noformat}CREATE NONCLUSTERED INDEX [IX_tblARInvoiceDetail_intTicketId] ON [dbo].[tblARInvoiceDetail] ([intTicketId]) INCLUDE ([intInvoiceId]) GO{noformat}   Ticket Undistribute response time before adding the index:   |Test #1|Test #2|Test #3| |14.87s|14.44s|12.06s| Ticket Undistribute response time after adding the index:   |Test #1|Test #2|Test #3| |1.30s|1.88s|1.22s| *Note* : This testing result was captured using MCP db.   !pastedImage_d171544_1.jpg!