mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-07 23:56:56 +01:00
Add BC performance knowledge from OptimAL learnings
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
07e324ddbc
commit
af94c135ad
37 changed files with 881 additions and 36 deletions
|
|
@ -1,15 +1,14 @@
|
|||
codeunit 50223 "Perf Sample CalcSums Bad"
|
||||
{
|
||||
procedure TotalRemaining(CustomerNo: Code[20]) Total: Decimal
|
||||
procedure TotalSales(CustomerNo: Code[20]) Total: Decimal
|
||||
var
|
||||
CustLedgerEntry: Record "Cust. Ledger Entry";
|
||||
begin
|
||||
CustLedgerEntry.SetCurrentKey("Customer No.");
|
||||
CustLedgerEntry.SetRange("Customer No.", CustomerNo);
|
||||
// One SQL query per row over a 10M-row ledger.
|
||||
if CustLedgerEntry.FindSet() then
|
||||
repeat
|
||||
CustLedgerEntry.CalcFields("Remaining Amount");
|
||||
Total += CustLedgerEntry."Remaining Amount";
|
||||
Total += CustLedgerEntry."Sales (LCY)";
|
||||
until CustLedgerEntry.Next() = 0;
|
||||
end;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue