Map

pgit: I Imported the Linux Kernel into PostgreSQL

pgit: I Imported the Linux Kernel into PostgreSQL

Author: Oliver Seifert Date: 2026-03-26 Source: https://oseifert.ch/blog/linux-kernel-pgit

Import Metrics

Metric Value
Total Commits 1,428,882
File Versions 24,384,844
Unique Blobs 3,089,589
Unique Paths 171,525
Import Time 2 hours 0 minutes 48 seconds
On-Disk Size 6.6 GB
Actual Data 2.7 GB

Hardware

Hetzner dedicated server in Finland:

  • AMD EPYC 7401P (24 cores/48 threads)
  • 512 GB DDR4 ECC RAM
  • 2ร—1.92 TB SSD in RAID 0
  • 350 GB xpatch content cache

Compression

pgit achieved 53.5x compression on actual data (2.7 GB) vs raw uncompressed objects (144.43 GB). git gc --aggressive reached 74.1x (1.95 GB), but pgit provides queryable SQL access.

Data Breakdown

Component Size
Commits (xpatch) 600.6 MB
Text Content (xpatch) 1.3 GB
Binary Content (xpatch) 2.0 MB
File References 2.1 GB
Paths 13.2 MB

Key Findings

Contributors

  • 38,506 unique authors, only 1,540 unique committers (25:1 ratio)
  • 14,000 authors contributed exactly one patch and never returned
  • Three people merged 22.5% of all commits: David S. Miller (7.9%), Greg Kroah-Hartman, Linus Torvalds

Code Metrics

  • 90% of commits touch 5 files or fewer
  • 61.3% of commits modify just 1 file
  • Largest single commit touched 53,003 files (merge commits from subsystem maintainers)

File Coupling (Co-changes)

Most frequently changed together:

  1. i915/intel_drv.h + i915/intel_display.c (1,117 times)
  2. net/core/dev.c + include/linux/netdevice.h (1,087 times)
  3. i915/i915_gem.c + i915/i915_drv.h (1,072 times)

Intel i915 GPU driver appears 8 times in the top 30 coupled pairs.

Corporate Contributions

Organization Commits Authors Commits/Author
Intel 83,187 1,704 49
Red Hat 72,695 658 110
kernel.org 69,451 227 306
Linaro 43,524 263 166
AMD 42,270 1,017 42

Individual contributors (Gmail) peaked at 12% in 2010, declining to 8% by 2025.

Profanity

Only 7 f-bombs across 1.4M commits โ€” Al Viro (5), Linus Torvalds (2). "workaround" appears 8,435 times.

Notable

  • Linus's initial git import (1da177e4c3f4) has 665 bug fix references, used as shorthand for bugs that existed "forever"
  • Only 3 triple reverts in Linux history, all in memory management or staging
  • GPU drivers (drm/amd/display, drm/amdgpu, drm/i915) account for ~516 reverts โ€” nearly 10% of all kernel reverts
  • Kent Overstreet devoted 13 years to bcachefs, from 2011 through 2023 mainline merge

Query Performance

All without materialized views:

  • Storage & compression stats: 2.1s
  • Churn analysis (24.4M file refs): 2.3s
  • Hotspots: 1.8s
  • File coupling: 48.3s
  • Full-text search (all history): 44s

Install

go install github.com/imgajeed76/pgit/v4/cmd/pgit@latest