CS FundamentalsHardAmazon · Microsoft MCQ pattern

A table's clustered index key is UUID-based (a random 128-bit value) rather than a sequential integer. What problem does this commonly cause for INSERT-heavy workloads, compared to a sequential (e.g. auto-increment) clustering key?

  1. A. UUIDs make SELECT queries impossible
  2. B. No problem; UUIDs and sequential integers perform identically for inserts
  3. C. Random UUID values cause inserts to land at random points throughout the index rather than always at the end, leading to frequent page splits and poor locality (more I/O, more fragmentation) compared to always appending at the end with a sequential key
  4. D. UUIDs cannot be indexed at all

Correct answer: C. Random UUID values cause inserts to land at random points throughout the index rather than always at the end, leading to frequent page splits and poor locality (more I/O, more fragmentation) compared to always appending at the end with a sequential key

Because the clustered index physically orders rows by its key, a monotonically increasing key (like an auto-increment id) lets every insert simply append to the last page. A random UUID key scatters inserts across the whole key range, constantly forcing page splits in already-full, 'cold' pages and hurting both insert throughput and physical locality for range scans — a well-known operational trade-off of UUID primary/clustering keys.

More DBMS and SQL questions

Exams that ask this topic