bcquality/microsoft/knowledge/performance
Jesper Schulz-Wedde a9f3c50863 Regenerate microsoft/knowledge from upstream BCApps instructions
The previous LLM-generated knowledge files contained factual
hallucinations. The most visible was the claim that `FindFirst` /
`FindLast` "forces a full-table scan" on an unfiltered record - it does
not; those APIs return a single row via the current key.

Other inaccuracies the audit found and fixed:

* `FindSet(true)` was described as "taking a LockTable". The correct
  upstream phrasing is that `FindSet(true)` sets
  `ReadIsolation::UpdLock` on the read. UpdLock and LockTable are
  related but distinct mechanisms.
* The list of production-scale tables had been invented beyond the
  upstream source (e.g. "Detailed Cust. Ledg. Entry") without a
  citation. The regenerated list matches the ten tables upstream lists
  with their P95 row counts.
* `SetLoadFields` guidance had been augmented with an extra mechanism
  claim ("the database resolves the filter using the index without
  hydrating the value") not present in upstream.

Approach: full regeneration of `microsoft/knowledge/` from the six
upstream BCApps Code Review instruction files, with Microsoft Learn /
the AL language reference as a secondary source. Every claim in every
regenerated file is anchored to a verbatim upstream quote (or a Learn
URL); the audit trail lives in artifacts/trace-<domain>.json on the
session workspace.

The PR #11 transaction/error-handling cluster is preserved verbatim:

* performance/understand-implicit-transaction-boundary.md
* performance/codeunit-run-as-atomic-sub-operation.{md,good.al,bad.al}
* performance/codeunit-run-requires-prior-commit-inside-transaction.{md,good.al,bad.al}
* performance/use-tryfunction-for-error-catching-not-rollback.{md,good.al,bad.al}
* performance/avoid-commit-inside-loops.{md,good.al,bad.al}
* security/commitbehavior-attribute-scopes-explicit-commits.{md,good.al,bad.al}
* testing/transactionmodel-attribute-governs-test-transactions.{md,good.al,bad.al}

These articles already cite Microsoft Learn and were carefully
cross-referenced; the regeneration skips their topics rather than
duplicating them.

File counts after regeneration:

  performance   35 .md  (5 preserved + 30 new)
  privacy       17 .md
  security      18 .md  (1 preserved + 17 new)
  style         33 .md
  testing        1 .md  (preserved)
  ui            19 .md
  upgrade       18 .md

Total 141 atomic knowledge files, each strictly one rule. All pass
.github/scripts/validate_frontmatter.py with 0 errors and 0 warnings.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-21 09:53:09 +02:00
..
addloadfields-in-report-onpredataitem.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
addloadfields-in-report-onpredataitem.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
addloadfields-in-report-onpredataitem.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
admin-and-migration-pages-tolerate-lower-perf.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
apply-filters-before-iterating.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
apply-filters-before-iterating.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
apply-filters-before-iterating.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
apply-guards-before-get.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
apply-guards-before-get.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
apply-guards-before-get.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-commit-inside-loops.bad.al Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
avoid-commit-inside-loops.good.al Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
avoid-commit-inside-loops.md Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
avoid-get-inside-loop-on-large-table.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-get-inside-loop-on-large-table.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-get-inside-loop-on-large-table.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-recordref-in-hot-loop.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-recordref-in-hot-loop.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-recordref-in-hot-loop.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-redundant-get-when-record-already-loaded.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-redundant-get-when-record-already-loaded.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-redundant-get-when-record-already-loaded.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-user-prompts-inside-transactions.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-user-prompts-inside-transactions.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
avoid-user-prompts-inside-transactions.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
calcsums-instead-of-calcfields-in-loop.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
calcsums-instead-of-calcfields-in-loop.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
calcsums-instead-of-calcfields-in-loop.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
codeunit-run-as-atomic-sub-operation.bad.al Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
codeunit-run-as-atomic-sub-operation.good.al Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
codeunit-run-as-atomic-sub-operation.md Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
codeunit-run-requires-prior-commit-inside-transaction.bad.al Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
codeunit-run-requires-prior-commit-inside-transaction.good.al Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
codeunit-run-requires-prior-commit-inside-transaction.md Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
do-not-locktable-in-read-only-procedure.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
do-not-locktable-in-read-only-procedure.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
do-not-locktable-in-read-only-procedure.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
do-not-modify-in-onaftergetrecord.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
do-not-modify-in-onaftergetrecord.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
do-not-modify-in-onaftergetrecord.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
do-not-remove-sourcetabletemporary-from-api-page.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
do-not-remove-sourcetabletemporary-from-api-page.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
do-not-remove-sourcetabletemporary-from-api-page.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
findset-true-applies-updlock-on-read.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
findset-true-applies-updlock-on-read.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
findset-true-applies-updlock-on-read.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
flowfield-source-key-needs-sumindexfields.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
flowfield-source-key-needs-sumindexfields.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
flowfield-source-key-needs-sumindexfields.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
guard-event-subscribers-before-db-call.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
guard-event-subscribers-before-db-call.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
guard-event-subscribers-before-db-call.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
maintainsqlindex-false-breaks-flowfield-sift.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
maintainsqlindex-false-breaks-flowfield-sift.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
pair-findset-with-next-loop.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
pair-findset-with-next-loop.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
pair-findset-with-next-loop.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
pass-false-to-insert-when-trigger-not-needed.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
pass-false-to-insert-when-trigger-not-needed.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
prefer-dictionary-over-temporary-table-for-lookups.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
prefer-modifyall-over-per-row-modify.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
prefer-modifyall-over-per-row-modify.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
prefer-modifyall-over-per-row-modify.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
prefer-readisolation-over-locktable-for-reads.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
prefer-readisolation-over-locktable-for-reads.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
prefer-readisolation-over-locktable-for-reads.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
production-scale-tables-warrant-extra-analysis.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
setcurrentkey-aligns-key-with-filters.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
setcurrentkey-aligns-key-with-filters.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
singleton-setup-tables-need-no-access-optimization.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
temporary-tables-have-no-database-cost.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
triggers-and-media-field-regress-modifyall.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
understand-implicit-transaction-boundary.md Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
use-get-instead-of-findfirst-on-full-primary-key.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-get-instead-of-findfirst-on-full-primary-key.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-get-instead-of-findfirst-on-full-primary-key.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-isempty-for-existence-check.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-isempty-for-existence-check.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-isempty-for-existence-check.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-setloadfields-for-partial-records.bad.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-setloadfields-for-partial-records.good.al Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-setloadfields-for-partial-records.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-textbuilder-for-string-concatenation-in-loops.md Regenerate microsoft/knowledge from upstream BCApps instructions 2026-05-21 09:53:09 +02:00
use-tryfunction-for-error-catching-not-rollback.bad.al Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
use-tryfunction-for-error-catching-not-rollback.good.al Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00
use-tryfunction-for-error-catching-not-rollback.md Transaction and error handling in BC AL - new knowledge articles 2026-04-23 20:58:02 +03:00