bcquality/microsoft/knowledge/performance/prefer-modifyall-over-per-row-modify.good.al
Jesper Schulz-Wedde 87ba36e650
Add BC performance knowledge from OptimAL learnings (#198)
* Add BC performance knowledge from OptimAL learnings

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Address review feedback on performance guidance

Clarify predicate-supporting keys versus covering queries, demonstrate proven cache reuse, and evaluate the updated partial-load and bulk-update rules.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Jesper Schulz-Wedde <jesper.schulzwedde@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
2026-09-29 17:21:28 +02:00

27 lines
692 B
AL

table 50242 "Perf Import Staging Entry"
{
fields
{
field(1; "Entry No."; Integer) { }
field(2; "Batch ID"; Guid) { }
field(3; Processed; Boolean) { }
}
keys
{
key(PK; "Entry No.") { Clustered = true; }
}
}
codeunit 50242 "Perf Sample ModifyAll Good"
{
procedure MarkBatchProcessed(BatchId: Guid)
var
StagingEntry: Record "Perf Import Staging Entry";
begin
StagingEntry.SetRange("Batch ID", BatchId);
StagingEntry.SetRange(Processed, false);
// Processed has no OnValidate logic, and the equivalent loop uses Modify(false).
StagingEntry.ModifyAll(Processed, true, false);
end;
}