---
title: "Discussion on \"UUIDv4 vs UUIDv7 vs Auto-Increment: I Inserted 10 Million Rows to Find Out\" | Hashnode"
description: "Discussion on \"UUIDv4 vs UUIDv7 vs Auto-Increment: I Inserted 10 Million Rows to Find Out\". I loaded 10M rows into Postgres with each key type. UUIDv4 was 3.5x slower than bigint and wrote 18x more WAL than UUIDv7. Here's what to use."
url: "https://hashnode.com/posts/uuidv4-vs-uuidv7-vs-auto-increment-i-inserted-10-million-rows-to-find-out-0dxzt/6b0d25718cdb698e5fb1dcc3"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [UUIDv4 vs UUIDv7 vs Auto-Increment: I Inserted 10 Million Rows to Find Out](https://blog.zyvop.com/uuidv4-vs-uuidv7-vs-auto-increment-i-inserted-10-million-rows-to-find-out-0dxzt?utm_source=hashnode&utm_medium=feed)

I loaded 10M rows into Postgres with each key type. UUIDv4 was 3.5x slower than bigint and wrote 18x more WAL than UUIDv7. Here's what to use.

1d ago · 12 min read · blog.zyvop.com  
Read the article

-   [#backend](https://hashnode.com/tag/backend)
-   [#benchmark](https://hashnode.com/tag/benchmark)
-   [#databaseperformance](https://hashnode.com/tag/databaseperformance)
-   [#postgresql](https://hashnode.com/tag/postgresql)
-   [#uuid](https://hashnode.com/tag/uuid)

## Written by

[ZyVOP](https://hashnode.com/@zyvop)

@zyvop · Delhi, India

  
[View profile](https://hashnode.com/@zyvop)

The Developer Publishing Hub

One platform to write, cross-post to Dev.to, Medium, WordPress, Hashnode, and Bluesky, and protect your SEO with canonical links. Zero paywalls and full content ownership.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
