---
title: "I Load Tested 4 Postgres PK Types So You Don't Have To"
url: https://daily.dev/posts/i-load-tested-4-postgres-pk-types-so-you-don-t-have-to-gj04zhb2t
source_url: https://www.youtube.com/watch?v=pMFZSHbQmYU
type: video:youtube
source: "Database Star"
published: 2026-06-15T02:19:49.863Z
updated: 2026-06-15T02:20:09.282Z
tags: ["database", "postgresql", "load-testing"]
reading_time: 12
upvotes: 5
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Load Tested 4 Postgres PK Types So You Don't Have To

**[Database Star](https://daily.dev/sources/database-star)** · 12 min read · 5 upvotes · 0 comments

## Summary

A load test comparing four PostgreSQL primary key types — bigint identity, text, UUID v4, and UUID v7 — on select-by-primary-key performance at 1 million rows using K6. Across all concurrency levels (1 to 50 virtual users), all four types performed nearly identically, with differences of only 2–3%. The reason: all indexes fit within Postgres's 128 MB shared buffer cache, so every lookup was a memory read and disk I/O differences never materialized. The post explains when divergence would appear (tens of millions of rows, memory-constrained servers), and offers practical guidance: use int if you don't need globally unique IDs, prefer UUID v7 over v4 if you do, and consider insert performance separately since it tells a different story.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=pMFZSHbQmYU>

## Similar posts on daily.dev

- [Avoid UUID Version 4 Primary Keys](https://daily.dev/posts/avoid-uuid-version-4-primary-keys-5pot7xhqf) · Hacker News · 79 upvotes · 10 comments
- [The Time Traveler's Primary Key](https://daily.dev/posts/the-time-traveler-s-primary-key-x5yvsdpzm) · Planet PostgreSQL · 0 upvotes · 0 comments

---

Tags: [#database](https://daily.dev/tags/database), [#postgresql](https://daily.dev/tags/postgresql), [#load-testing](https://daily.dev/tags/load-testing)

[View this post on daily.dev](https://daily.dev/posts/i-load-tested-4-postgres-pk-types-so-you-don-t-have-to-gj04zhb2t)
