Hacker News new | ask | show | jobs
by bob1029 1777 days ago
If you are getting good compression on your primary keys, this may be cause for alarm.

These should be high-entropy items.

1 comments

The sole constraint on a primary key is that it is unique. Even in distributed systems, deterministically unique keys are almost always much more compressible than probabilistically unique keys, which is a double win.

Should you desire a high-entropy key, e.g. for hash tables or security, this can be trivially derived from the low-entropy key while still guaranteeing deterministic uniqueness.

Compressible primary keys are superior in every way.