Fix Aged Accounts Receivable (Report 120) performance on large ledger history#9195
Open
ventselartur wants to merge 1 commit into
Open
Fix Aged Accounts Receivable (Report 120) performance on large ledger history#9195ventselartur wants to merge 1 commit into
ventselartur wants to merge 1 commit into
Conversation
… history Report 120 issued a Detailed Cust. Ledg. Entry FindSet per temp ledger entry with full records, an N+1 pattern that scaled with total Detailed Cust. Ledg. Entry history and effectively hung on 2-3 years of data. Add SetLoadFields to the Detailed Cust. Ledg. Entry loop so only the four columns consumed by the loop are read, reducing per-row SQL cost. Propagated from W1 to the ES and NA base layers via Miapp. Work item: AB#640854 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Copilot PR ReviewIteration 1 · Outcome: completed Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630 Findings by domainFindings split into Knowledge-backed (cite a BCQuality article) and Agent (the agent's own judgement, no matching BCQuality rule).
Totals: 0 knowledge-backed · 1 agent findings. Orchestrator pre-filter (13 file(s) excluded)
Findings produced by the Copilot CLI agent against BCQuality at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The standard Aged Accounts Receivable report (Report 120, Base Application) does not complete on databases holding 2-3 years of Customer Ledger history — the UI hangs on "Working on it… Rows generated". A CPU profile (~334s, ~99% in SQL) traced ~22-35% of the time to the per-row Detailed Cust. Ledg. Entry loop, which issued a full-record
FindSetfor every temporary ledger entry. This N+1 pattern scales with total Detailed Cust. Ledg. Entry history rather than with the size of the open receivables population, even though aging is a point-in-time snapshot anchored to a single "Aged As Of" date.Summary
SetLoadFieldson the Detailed Cust. Ledg. Entry loop in Report 120 so only the four columns the loop consumes (Entry Type,Posting Date,Amount,Amount (LCY)) are read, cutting per-row SQL cost —Cust. Ledger Entry No.is only a filter and needs no load.Work item: AB#640854