Get the latest tech news

PostgreSQL and UUID as Primary Key


PostgreSQL and UUID as primary key

These differences are not that important in small tables, but become an issue once you start storing hundreds of thousands or millions of rows. The results look a little random especially when comparing times for a table with regular text column and uuid v4: But if there's a chance you will have large dataset or big traffic - it is better to do it right from the beginning as changing primary keys can be quite a challenge.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of PostgreSQL

PostgreSQL

Photo of UUID

UUID

Photo of primary key

primary key

Related news:

News photo

Waiting for PostgreSQL 14: SEARCH and CYCLE clauses

News photo

Dblab: Interactive Terminal Client for PostgreSQL, MySQL, SQLite3 and Oracle

News photo

Speedup of deletes on PostgreSQL