3 ms·
Depends on your storage system. For the one I work with most, a common prefix on your primary keys will hurt performance because it causes hotspotting. A UUID p
by hn_go_brrrrr 5y ago
Depends on your storage system. For the one I work with most, a common prefix on your primary keys will hurt performance because it causes hotspotting. A UUID primary key would be the best case because it optimally shards writes. A ULID would be the worst case -- I would need to store it with the bits reversed.
- stevesimmons 5y agoAnd conversely, if storage is chunked (e.g. parquet files on S3), having time-ordered uuids may turn it into essentially an append-only log-structured store. Here hotspotting is the aim, since it lets you efficiently prune query plans from index scans to direct reads of the right chunk.