Address performance retrieval review

Retrieve Commit-in-loop guidance precisely, process exact checkpoint key lists, and narrow clone-before-write discovery.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 85be3fc4-5253-47b8-ba1b-6b8fd188fcea
This commit is contained in:
Jesper Schulz-Wedde 2026-07-14 11:59:19 +02:00
parent e374a8a4b8
commit 737fbe5cd3
4 changed files with 27 additions and 27 deletions

View file

@ -26,36 +26,33 @@ codeunit 50128 "Perf Sample CommitInLoop Good"
local procedure NormalizeNextChunk(var LastCustomerNo: Code[20]): Boolean
var
Customer: Record Customer;
TempCustomer: Record Customer temporary;
CustomerChunk: Query "Perf Customer Chunk";
FirstCustomerNo: Code[20];
LastChunkCustomerNo: Code[20];
begin
CustomerChunk.TopNumberOfRows(500);
if LastCustomerNo <> '' then
CustomerChunk.SetFilter(CustomerNo, '>%1', LastCustomerNo);
CustomerChunk.Open();
if not CustomerChunk.Read() then begin
CustomerChunk.Close();
exit(false);
end;
FirstCustomerNo := CustomerChunk.CustomerNo;
repeat
while CustomerChunk.Read() do begin
TempCustomer.Init();
TempCustomer."No." := CustomerChunk.CustomerNo;
TempCustomer.Insert();
LastChunkCustomerNo := CustomerChunk.CustomerNo;
until not CustomerChunk.Read();
end;
CustomerChunk.Close();
Customer.SetCurrentKey("No.");
Customer.SetRange("No.", FirstCustomerNo, LastChunkCustomerNo);
if not Customer.FindSet(true) then begin
LastCustomerNo := LastChunkCustomerNo;
exit(true);
end;
if TempCustomer.IsEmpty() then
exit(false);
repeat
Customer.Name := UpperCase(Customer.Name);
Customer.Modify();
until Customer.Next() = 0;
Customer.LockTable();
if TempCustomer.FindSet() then
repeat
if Customer.Get(TempCustomer."No.") then begin
Customer.Name := UpperCase(Customer.Name);
Customer.Modify();
end;
until TempCustomer.Next() = 0;
LastCustomerNo := LastChunkCustomerNo;
exit(true);