2 ms·
One way to generate UUIDs in a more index-friendly way, at least in Postgres, is to use uuid-ossp's uuid_generate_v1mc() function. They end up sequential, so ma
by emilong 10y ago
One way to generate UUIDs in a more index-friendly way, at least in Postgres, is to use uuid-ossp's uuid_generate_v1mc() function. They end up sequential, so maybe not the best if you need total unpredictability, but the lower order bits should be reasonably random.
h/t to Wayne E. Seguin for his article http://www.starkandwayne.com/blog/uuid-primary-keys-in-postgresql/ http://www.starkandwayne.com/blog/uuid-primary-keys-in-postg...
Docs here: https://www.postgresql.org/docs/9.4/static/uuid-ossp.html https://www.postgresql.org/docs/9.4/static/uuid-ossp.html