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?
- A. UUIDs make SELECT queries impossible
- B. No problem; UUIDs and sequential integers perform identically for inserts
- 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
- 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
- After a crash, the analysis phase of ARIES recovery scans the log forward from the last checkpoint to rebuild the transaction table…
- A relation Enrollment(studentid, courseid, semester, grade) has candidate key (studentid, courseid, semester). A functional dependency…
- A poorly designed table stores repeating groups as separate columns: Student(sid, sname, course1, course2, course3). What specific 1NF…
- A relation R(A, B, C, D) decomposes into R1(A, B) and R2(A, C, D). For this decomposition to be DEPENDENCY PRESERVING, what must hold?
- Decomposing R(A, B, C) with FDs A → B and B → C into BCNF can require R1(A, B) and R2(B, C). Is this decomposition dependency-preserving?
- A relation R(A, B, C) has FDs A → B and A → C, but NOT B → C or C → B (B and C are independent given A). Decomposing R into R1(A, B) and…