Ashhar Ahmad Khan created FINERACT-2579:
-------------------------------------------

             Summary: Performance issue: N×5 repeated entity lookups inside 
generateLoanProvisioningEntry() loop
                 Key: FINERACT-2579
                 URL: https://issues.apache.org/jira/browse/FINERACT-2579
             Project: Apache Fineract
          Issue Type: Bug
            Reporter: Ashhar Ahmad Khan


The generateLoanProvisioningEntry() method in 
ProvisioningEntriesWritePlatformServiceJpaRepositoryImpl fires five individual 
repository queries per loop iteration — LoanProduct, Office, 
ProvisioningCategory, and two GLAccounts — for every row returned by 
retrieveLoanProductsProvisioningData().

Since all IDs are known before the loop starts, these can be replaced with four 
bulk findAllById() calls before the loop with in-memory map lookups inside it, 
reducing N×5 DB round-trips to 4 regardless of entry count.

Same class of redundancy as FINERACT-2561, but on a heavier batch path.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to