Improve inventory costing reads and exclusion lookups - #11601
Draft
Chethan Thopaiah (ChethanT) wants to merge 4 commits into
Draft
Chethan Thopaiah (ChethanT) wants to merge 4 commits into
Chethan Thopaiah (ChethanT) wants to merge 4 commits into
Conversation
Add capacity cost-share and SQL-growth regression coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Chethan Thopaiah (ChethanT)
deployed
to
triage
September 18, 2026 08:43 — with
GitHub Actions
Active
Contributor
|
Could not find a linked work item. Please link one in either of these ways: (1) link an ADO work item using the pattern 'AB#' followed by the work item number - you may use the 'Fixes' keyword to automatically resolve it when the pull request is merged, e.g. 'Fixes AB#1234'; or (2) link a GitHub issue of type 'Task' using the pattern 'Fixes #' followed by the issue number, e.g. 'Fixes #1234'. |
Preserve ledger record state and temporary buffers while bounding SQL row transfer. Add six costing regression tests and propagate dictionary membership to APAC and RU. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove manual APAC and RU edits. Defer country propagation to MiApp after the W1 work is complete. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… state Create required transfer posting setup, explicitly configure SKU coverage prerequisites, and compare equivalent per-item FIFO adjustment states without changing assertions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
What & why
Measured, contained changes from an inventory cost-adjustment performance investigation:
SetAutoCalcFieldsandFindSet, rather than calculating them separately for each capacity entry.CalcSumsin W1 instead of transferring and summing every value entry in AL. Preserve the last record's non-total fields, the resulting key and filters, empty-scope behavior, temporary records, and the existing adjustment-buffer overlay.This draft does not implement the broader cache, transaction, scheduling, or parallel-processing proposals.
Scope is W1 only. Country-specific edits have been removed; propagation to country versions is deferred to MiApp at the end of the W1 work.
Customer assessment is out of scope at this stage and is not a prerequisite for continuing. Evaluate changes using source analysis and controlled synthetic workloads, keeping theoretical benefits separate from measured results.
Linked work
An approved issue/work-item link is still required before this draft is ready for review. No issue is claimed as fixed.
How I validated this
Controlled before/after comparison
Rebuilt the original and optimized W1 engines as successive package versions and verified the installed engine and test-app versions before each run. Ran the same 58 tests, using the same corrected fixtures, across:
Only the two newly added performance-budget guards fail on the original engine: capacity SQL-statement growth and ledger SQL-row transfer. Both pass on the optimized engine. All accounting and existing coverage assertions pass on both engines.
Baseline prerequisites corrected
Never; the two coverage tests also set this explicitly.AvgPurchRevalSalesnow creates an in-transit location with posting setup rather than selecting an arbitrary demo location.TestBug270797_UsingTransfercreates a destination location with posting setup and uses the same destination for the later sale.VSTF268387explicitly selects item-level costing so the generated SKUs are included. Its exact counts remain unchanged: two hits for one SKU and one additional hit per additional SKU.Capacity measurement
The original calculation executes 31, 112, and 210 SQL statements for fixtures containing 10, 50, and 100 capacity entries. With batching, both larger fixtures use at most 10 more statements than the 10-entry fixture. Passing tests do not print absolute optimized counts.
Ledger measurement
One- and two-entry histories also pass a separate guard of at most three rows and two SQL statements. Passing tests do not print the absolute optimized counters, so only these bounds are established.
SessionInformation.SqlRowsReadmeasures session SQL rows, not physical database logical reads. Read-only cached-plan inspection confirms the ledger aggregate uses a key lookup andUPDLOCKin the exercised workload: lower row transfer does not imply constant SQL work or shorter lock duration. Paired logical-read/elapsed-time measurements, memory measurements, and synthetic contention testing remain outstanding. Customer-scale latency assessment is deferred, not a blocker for continuing this work. Country propagation and validation will follow the W1 work.Risk & compatibility
No schema, public interface, transaction boundary, G/L posting, or scheduling changes. Existing manufacturing subscriber hooks and the ledger calculation's handled override remain in place. Persistent ledger totals still receive the temporary adjustment-buffer costs through the existing callers.
FindLastpreserves the public record-state contract before aggregation, but can add one SQL round trip for tiny histories. No SIFT/index addition or customer-scale end-to-end speedup is claimed.Dictionary membership trades additional per-entry bookkeeping for hash-based membership lookups; large-workload memory impact still needs measurement. This remains a draft while the broader accounting and performance gates are incomplete.