---
id: change/bcquality/198
type: change
title: "#198 Add BC performance knowledge from OptimAL learnings"
summary: Adds six performance knowledge articles with paired good and bad AL examples on workload-based and overlapping indexes, buffered inserts, aggregate-before-write, scoped reuse and repeated validation. Refines existing guidance on partial loads, temporary buffers, bulk updates, existence checks, primary-key caching and FlowField versus stored totals.
tier: official
language: en
tags:
  - feature
  - main
system: platform
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:03:52.830Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 87ba36e650dde6a1cd4c1bd499303cbde3a6a47f
evidence:
  - kind: code
    url: https://github.com/microsoft/BCQuality/pull/198
    title: "microsoft/BCQuality#198: Add BC performance knowledge from OptimAL learnings"
    date: "2026-09-29"
    commit: 87ba36e650dde6a1cd4c1bd499303cbde3a6a47f
    t: null
    quote: null
links:
  learn: []
  objects: []
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 198
repo: microsoft/BCQuality
source_id: bcquality-prs
url: https://github.com/microsoft/BCQuality/pull/198
kind: pr
base_branch: main
major: null
merged_at: "2026-09-29T15:21:29Z"
author: JesperSchulz
author_type: User
community_contribution: false
labels: []
change_class: code
change_kind: feature
behavior_change: false
breaking: false
files:
  count: 37
  additions: 920
  deletions: 37
  al: 36
apps: []
objects_touched: []
objects_unjoined:
  - path: microsoft/knowledge/performance/aggregate-before-persisting-intermediate-results.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/aggregate-before-persisting-intermediate-results.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/aggregate-before-persisting-intermediate-results.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/avoid-get-inside-loop-on-large-table.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/avoid-repeating-unchanged-validation.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/avoid-repeating-unchanged-validation.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/avoid-repeating-unchanged-validation.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/cache-repeated-filtered-results-with-explicit-scope.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/cache-repeated-filtered-results-with-explicit-scope.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/cache-repeated-filtered-results-with-explicit-scope.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/calcsums-instead-of-calcfields-in-loop.bad.al
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/calcsums-instead-of-calcfields-in-loop.good.al
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/calcsums-instead-of-calcfields-in-loop.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/design-covering-keys-from-read-pattern.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/design-covering-keys-from-read-pattern.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/design-covering-keys-from-read-pattern.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/isempty-before-findset-is-extra-round-trip.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/prefer-modifyall-over-per-row-modify.good.al
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/prefer-modifyall-over-per-row-modify.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/preserve-buffered-inserts-by-separating-target-reads.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/preserve-buffered-inserts-by-separating-target-reads.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/preserve-buffered-inserts-by-separating-target-reads.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/primary-key-get-in-loop-is-transaction-cached.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/query-results-bypass-primary-key-cache.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/review-overlapping-keys-before-adding-an-index.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/review-overlapping-keys-before-adding-an-index.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/review-overlapping-keys-before-adding-an-index.md
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/setcurrentkey-sets-sort-order-not-index-hint.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/temporary-tables-have-no-database-cost.bad.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/temporary-tables-have-no-database-cost.good.al
    status: added
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/temporary-tables-have-no-database-cost.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/use-setautocalcfields-for-per-row-flowfields.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/use-setloadfields-for-partial-records.bad.al
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/use-setloadfields-for-partial-records.good.al
    status: modified
    reason: not-in-snapshot
  - path: microsoft/knowledge/performance/use-setloadfields-for-partial-records.md
    status: modified
    reason: not-in-snapshot
  - path: microsoft/skills/review/al-performance-review.md
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports: []
fixes_issues: []
work_items: []
systems:
  - platform
  - development
quote: null
joined_against:
  major: null
  commit: null
---

# #198 Add BC performance knowledge from OptimAL learnings

> Adds six performance knowledge articles with paired good and bad AL examples on workload-based and overlapping indexes, buffered inserts, aggregate-before-write, scoped reuse and repeated validation. Refines existing guidance on partial loads, temporary buffers, bulk updates, existence checks, primary-key caching and FlowField versus stored totals.

[Pull request](https://github.com/microsoft/BCQuality/pull/198) · merged into `main` on 2026-09-29 by JesperSchulz · 37 files (+920 -37), 36 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- Six new articles on workload-based keys, overlapping indexes, buffered inserts, aggregate-before-write, scoped result reuse and repeated validation
- Each new article has paired good and bad AL examples
- Existing guidance refined for partial loads, temporary buffers, bulk updates, existence checks, primary-key caching and FlowField versus stored-field totals
- SIFT-specific SetCurrentKey case clarified
- Performance-review retrieval and evaluation fixtures extended for the new rules

## AL objects touched

- `microsoft/knowledge/performance/aggregate-before-persisting-intermediate-results.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/aggregate-before-persisting-intermediate-results.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/aggregate-before-persisting-intermediate-results.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/avoid-get-inside-loop-on-large-table.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/avoid-repeating-unchanged-validation.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/avoid-repeating-unchanged-validation.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/avoid-repeating-unchanged-validation.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/cache-repeated-filtered-results-with-explicit-scope.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/cache-repeated-filtered-results-with-explicit-scope.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/cache-repeated-filtered-results-with-explicit-scope.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/calcsums-instead-of-calcfields-in-loop.bad.al`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/calcsums-instead-of-calcfields-in-loop.good.al`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/calcsums-instead-of-calcfields-in-loop.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/design-covering-keys-from-read-pattern.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/design-covering-keys-from-read-pattern.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/design-covering-keys-from-read-pattern.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/isempty-before-findset-is-extra-round-trip.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/prefer-modifyall-over-per-row-modify.good.al`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/prefer-modifyall-over-per-row-modify.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/preserve-buffered-inserts-by-separating-target-reads.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/preserve-buffered-inserts-by-separating-target-reads.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/preserve-buffered-inserts-by-separating-target-reads.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/primary-key-get-in-loop-is-transaction-cached.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/query-results-bypass-primary-key-cache.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/review-overlapping-keys-before-adding-an-index.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/review-overlapping-keys-before-adding-an-index.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/review-overlapping-keys-before-adding-an-index.md`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/setcurrentkey-sets-sort-order-not-index-hint.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/temporary-tables-have-no-database-cost.bad.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/temporary-tables-have-no-database-cost.good.al`: added, not in the BC? snapshot yet
- `microsoft/knowledge/performance/temporary-tables-have-no-database-cost.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/use-setautocalcfields-for-per-row-flowfields.md`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/use-setloadfields-for-partial-records.bad.al`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/use-setloadfields-for-partial-records.good.al`: modified, not in the BC? snapshot
- `microsoft/knowledge/performance/use-setloadfields-for-partial-records.md`: modified, not in the BC? snapshot
- `microsoft/skills/review/al-performance-review.md`: modified, not in the BC? snapshot

## Context

- Systems: platform, development

Source: metadata of a merged pull request in microsoft/BCQuality (bcquality): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
