DEV Community

Cover image for Making PostgreSQL xx slower for the Lulz
Dimitar Ivanov
Dimitar Ivanov

Posted on

Making PostgreSQL xx slower for the Lulz

Welcome, ladies and gentlemen, today we're in the Savanna and we'll hunt the a majestic creature. We'll hunt the PostgreSQL elephant - powerful, intelligent, and fast when left to roam free. Everybody says that about this elephant, well its time to prove them wrong.
Not to harm it, but to make it so slow it can barely run.
Time to grab our rifles, pack our provisions and let's go bag ourselves the slowest elephant in Savanna.

Constraints:

  • Must use latest version of PostgreSQL
  • No low hanging fruit (excessive indexes/joins or making threads sleep)

Stack:

  • PostgreSQL 18.1 (latest version as of January 2026)

My Specs:

  • Processor: Intel(R) Core(TM) i7-14700HX (2.10 GHz), 28 Threads
  • RAM: 32 GB
  • OS: Windows 11

Testing rules:

Each test will include me running multiple types of queries in this order - INSERT, UPDATE, SELECT, DELETE. Before each test I will run 2 warmups, one with 1k queries per type and another with 5k queries. All of the queries that mutate the state are in separate transactions.
There will be 3 cases that I run:

  • 10k queries per type
  • 20k queries per type
  • 30k queries per type

Baseline:

  • 10k queries
    • INSERT:
    • UPDATE:
    • SELECT:
    • DELETE:
  • 20k queries
    • INSERT:
    • UPDATE:
    • SELECT:
    • DELETE:
  • 30k queries
    • INSERT:
    • UPDATE:
    • SELECT:
    • DELETE:

Top comments (0)