community postPlatform, DevOps & Performancecommunity - not Microsoftreviewed - checked by Opus

Dynamics 365 Business Central: use sequential GUIDs when possible.

Sequential GUIDs provide significant performance advantages over random GUIDs in Dynamics 365 Business Central by reducing index fragmentation and page splits. Starting with version 27, developers can use the CreateSequentialGuid method to optimize database performance when GUIDs are used as primary keys.

post Stefano Demiliani

Stefano Demiliani · 2025-11-21 · 892 words · about 4 min

"The cost of writing GUID primary keys in a database containing 1,000,000 records is 10x the cost of writing INT primary keys."

Key points

  • Random GUIDs cause index fragmentation and expensive page splits when used as primary keys, with write costs 10x higher than integer keys on large tables
  • Sequential GUIDs insert data in order, keeping related records clustered and enabling the database to append to the index without reorganizing existing pages
  • Performance benchmarks showed 42% improvement on inserts and 31% on updates when switching from random to sequential GUIDs with 10 million records
  • Sequential GUIDs reduce storage overhead and improve cache locality, though they are more predictable than random GUIDs

Quotes

  • “The cost of writing GUID primary keys in a database containing 1,000,000 records is 10x the cost of writing INT primary keys.” (Illustrates why random GUIDs should be avoided for primary keys in large tables)
  • “Sequential GUIDs in this case was around 42% better on insert and around 31% better on updating records compared to using random GUIDs.” (Provides real-world benchmark data demonstrating concrete performance improvements at scale)

Context

  • Features: CreateSequentialGuid method, GUID generation, Index fragmentation reduction, Primary key optimization, Page split reduction, Cache locality improvement
  • Versions: 27, 2025 Wave 2

Source: Stefano Demiliani, community blog. Summary, key points and quotes are derived (CONTENT-NOTICE.md); read the original for the full text.