5 ms·
Excuse my possible ignorance, but how is more entropy in a primary key going to hurt index performance? The fanout in a b-tree is completely in control of the d
by tomsmeding 6y ago
Excuse my possible ignorance, but how is more entropy in a primary key going to hurt index performance? The fanout in a b-tree is completely in control of the database, and not dependent at all on properties of the data — apart, of course, from the size of the data, since typically the node fanout is precisely the number of fields that fit in one disk page. Randomness does not influence the size of a UUID on disk.
- rapidlua 6y agoWith random keys updates are going to touch way more pages than with sequential ones. It increases IO due to more dirty buffers and journaling.
- tomsmeding 6y agoPoint taken. Quite true.
- Tostino 6y agoMore reading on this for Postgres: https://www.2ndquadrant.com/en/blog/sequential-uuid-generators/ https://www.2ndquadrant.com/en/blog/sequential-uuid-generato...