code change · performancePlatform, DevOps & Performanceofficial - Microsoftreviewed - checked by Opus

#13953 Add key on Email Message Attachment Data to speed up email deletion (backport to releases/29.x)

A database key was added to the Data field of the Email Message Attachment table to improve performance when deleting emails, avoiding full table scans on large tenants.

Pull request · merged into releases/29.x (BC29) on 2026-11-12 by mynjj · 1 file (+4 -0), 1 AL · performance · tier official · reviewed (checked by Opus)

What changed

  • Adds a key on the Data (Media) field of the Email Message Attachment table
  • Avoids a full table scan per attachment when the platform checks for other references to the same media during deletion
  • Speeds up email deletion on large tenants, for example the Payables Agent email storage cleanup
  • Follows the approach of the existing key on the Document Attachment Media field
  • Backport of PR 13952 to releases/29.x

AL objects touched

Context

  • Work items: AB#658828
  • Labels: AL: System Application, Team: Integrations
  • Systems: platform

No source states these links: they share an object, a model read them, or a person found the same subject.

  • Send documents and emails — possibly related: Documents email and attachment functionality that benefits from database performance optimization. (model-linked)

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