A few years ago Peter Zaitsev, in a post titled “To UUID or not to UUID,” wrote: “There is timestamp based part in UUID which has similar properties to auto_increment and which could be used to have values generated at same point in time physically local in BTREE index.”
For this post I’ve rearranged the timestamp part of UUID (Universal Unique Identifier) and did some benchmarks.
Many people store UUID as char (36) and use as row identity value (PRIMARY KEY) because it is unique across every table, every database and every server and allow easy merging of records from different databases. But here comes the problem, using it as PRIMARY KEY causes the problems described below.
Problems with UUID
- UUID has 36 characters which makes it bulky.
- InnoDB stores data in …