Partial Record vs NST Caching : the strange case of Calculate Low Level Code
Partial record optimization using SetLoadFields can unexpectedly cause performance regressions when combined with NST caching in Business Central. The post demonstrates how adding SetLoadFields to the Production BOM Version record in the Calculate Low Level Code report creates multiple SQL queries instead of leveraging the platform's caching mechanism, resulting in thousands of redundant database calls in large datasets.

post Dynamics 365 Business Central tales, myths, legends. And something serious.
"When using partial records, the caching mechanism is somewhat hardly invoked (or not working at all)."
Key points
- Partial records loaded with SetLoadFields are not cached by the NST, while a full record read via FindLast is cached and reused.
- In Calculate Low Level Code, about 10,000 items without a Production BOM each trigger the same Production BOM Version lookup. With SetLoadFields this produced over 10,000 identical SQL statements instead of one.
- The regression appeared after an upgrade from 23.6 to 27.6 because a SetLoadFields call was added. Adding it in 23.6 shows the same lack of caching, so it is current platform design.
- Guidance cited from Microsoft’s platform team: use partial records for tables with many columns, a low share of columns retrieved, and large recordsets. Single-record reads gain less.
- SetLoadFields usage in the IT Base Application grew from 410 in 23.6 to 943 in 27.6, so similar cases may exist elsewhere.
Quotes
- “When using partial records, the caching mechanism is somewhat hardly invoked (or not working at all).” (Identifies the core issue that SetLoadFields bypasses NST caching, which is critical for understanding when partial records hurt performance)
AL objects mentioned
As named in the post. A name that matches one object page by exact type and name links to it; the others stay as named.
- report 152 “Calculate Low Level Code”
- codeunit 3687 “Low-Level Code Calculator”
- codeunit “Version Management”
- table 99000779 “Production BOM Version”
- table 27 “Item”
Not found in BC28-30: codeunit “Version Management”.
Context
- Features: SetLoadFields, Partial Records, NST Caching, Query Optimization, Performance Profiling, Telemetry Logging
- Versions: 23.6, 27.6, 28.4, 29, 2026 Wave 2
Source: Duilio Tacconi, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.