Skip to content

Instantly share code, notes, and snippets.

@stephanGarland
Last active August 2, 2023 01:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stephanGarland/ee38c699a9bb999894d760a10c227bc4 to your computer and use it in GitHub Desktop.
Save stephanGarland/ee38c699a9bb999894d760a10c227bc4 to your computer and use it in GitHub Desktop.
Benchmark results from loading some CSVs into Postgres, specifically testing UUIDs vs SERIAL

System Specifications

  • OS: Debian Bullseye 5.10.0-23-amd64
  • Virtualized: Yes (Proxmox)
  • CPU: E5-2650 v2 @ 2.60GHz
  • Allocated Core Count: 16
  • Allocated RAM: 64 GiB PC3-12800R
  • Disk: Samsung PM983 1.92 TiB via Ceph
    • NOTE: Benchmarks were taken on a RAM disk mount, local to VM
  • Filesystem: XFS
  • Mount Options: defaults,noatime
  • Postgres Version: 15.3
  • Postgres Options (non-default):
    • shared_buffers = 16GB
    • max_wal_size = 8GB

Results (all times in milliseconds)

Loaded 4000000 rows into each table

Statistics for various appends

Stats for pg_uuid_arr:
Runs: 6747.134 7133.889 10231.305 10714.742 
Min: 6747.134
Max: 10714.742
Avg: 8706.767
StdDev: 1779.767

Stats for pg_uuid_chr_arr:
Runs: 10194.071 11503.284 10500.059 19441.640 
Min: 10194.071
Max: 19441.640
Avg: 12909.763
StdDev: 3802.145

Stats for pg_identity_arr:
Runs: 4327.283 4747.486 4207.599 4321.452 
Min: 4207.599
Max: 4747.486
Avg: 4400.955
StdDev: 205.680

Stats for pg_serial_arr:
Runs: 4475.196 5387.383 5079.210 6211.649 
Min: 4475.196
Max: 6211.649
Avg: 5288.359
StdDev: 625.948

Stats for pg_identity_big_arr:
Runs: 4454.804 4820.864 4655.040 4675.806 
Min: 4454.804
Max: 4820.864
Avg: 4651.628
StdDev: 130.361

Stats for pg_serial_big_arr:
Runs: 4845.931 6301.442 5148.145 6039.787 
Min: 4845.931
Max: 6301.442
Avg: 5583.826
StdDev: 603.568
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment