MCP Seed Plant Speed Performance Improvements - Customer dropdown causing large number of database reads

Issue No: AR-14255
Created 1/18/2022 6:43:06 AM
Type Feature
Priority Major
Status Closed
Resolution Fixed
Fixed Version 20.1
Description *This issue relates to i21 Help Desk ticket:* [ HDTN-268048 - MCP Seed Plant Speed Performance Improvements|https://helpdesk.irely.com/iRelyi21live/#/HD/Ticket/?ticket=HDTN-268048]     *Steps* :   # Create a new invoice # Click the dropdown for Customer field   *Issue* : Customer dropdown causes a large number of database reads   Sample Query:   {noformat}SET STATISTICS IO ON SET STATISTICS TIME ON SELECT [Extent1].[intEntityId] AS [intEntityId], [Extent1].[strCustomerNumber] AS [strCustomerNumber], [Extent1].[strName] AS [strName], [Extent1].[strCurrency] AS [strCurrency], [Extent1].[strWarehouse] AS [strWarehouse], [Extent1].[intWarehouseId] AS [intWarehouseId], [Extent1].[dblARBalance] AS [dblARBalance], [Extent1].[dblCreditLimit] AS [dblCreditLimit], [Extent1].[strTerm] AS [strTerm], [Extent1].[ysnActive] AS [ysnActive], [Extent1].[ysnHasBudgetSetup] AS [ysnHasBudgetSetup], [Extent1].[ysnCreditHold] AS [ysnCreditHold], [Extent1].[ysnPORequired] AS [ysnPORequired], [Extent1].[intPaymentMethodId] AS [intPaymentMethodId], [Extent1].[strPaymentMethod] AS [strPaymentMethod], [Extent1].[intCreditStopDays] AS [intCreditStopDays], [Extent1].[strCreditCode] AS [strCreditCode], [Extent1].[intEntityContactId] AS [intEntityContactId], [Extent1].[strContactName] AS [strContactName], [Extent1].[strShipToLocationName] AS [strShipToLocationName], [Extent1].[strShipToAddress] AS [strShipToAddress], [Extent1].[strShipToCity] AS [strShipToCity], [Extent1].[strShipToState] AS [strShipToState], [Extent1].[strShipToZipCode] AS [strShipToZipCode], [Extent1].[strShipToCountry] AS [strShipToCountry], [Extent1].[strBillToLocationName] AS [strBillToLocationName], [Extent1].[strBillToAddress] AS [strBillToAddress], [Extent1].[strBillToCity] AS [strBillToCity], [Extent1].[strBillToState] AS [strBillToState], [Extent1].[strBillToZipCode] AS [strBillToZipCode], [Extent1].[strBillToCountry] AS [strBillToCountry], [Extent1].[intShipToId] AS [intShipToId], [Extent1].[intBillToId] AS [intBillToId], [Extent1].[strSalesPersonName] AS [strSalesPersonName], [Extent1].[intSalespersonId] AS [intSalespersonId], [Extent1].[intCurrencyId] AS [intCurrencyId], [Extent1].[intTermsId] AS [intTermsId], [Extent1].[ysnProspect] AS [ysnProspect], [Extent1].[intFreightTermId] AS [intFreightTermId], [Extent1].[strFreightTerm] AS [strFreightTerm], [Extent1].[strFobPoint] AS [strFobPoint], [Extent1].[ysnHasPastDueBalances] AS [ysnHasPastDueBalances], [Extent1].[intShipViaId] AS [intShipViaId], [Extent1].[strShipViaName] AS [strShipViaName], [Extent1].[intCreditLimitReached] AS [intCreditLimitReached], [Extent1].[ysnHasCustomerCreditApprover] AS [ysnHasCustomerCreditApprover] FROM [dbo].[vyuEMEntityCustomerSearch] AS [Extent1] WHERE (1 = [Extent1].[ysnCustomer]) AND (1 = [Extent1].[ysnActive]) AND ([Extent1].[intWarehouseId] IN (-99,-99,1)) ORDER BY [Extent1].[intEntityId] ASC OFFSET 0 ROWS FETCH NEXT 100 ROWS ONLY SET STATISTICS TIME OFF SET STATISTICS IO OFF{noformat} As we can see in the IO and TIME statistics below, the query is causing a large number of reads on certain tables.   !pastedImage_d177677_0.png|height=599,width=1862!