frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Ask HN: How can I load test PostgreSQL but avoid changing actual data?

1•LawZiL•9mo ago
I'm running a load test on my Node.js application and want to simulate realistic write-heavy scenarios to stress test the system — especially the PostgreSQL database.

There's a part of the code that performs UPDATE queries, but during load testing, I don't want these updates to actually change the state of the database. However, I still want the database to experience the full impact of the update — query planning, locking, I/O, WAL writes, etc. — so I can measure how it affects performance under peak load.

Is there a best-practice approach to achieve this?

So far, the most viable option I’ve found is to wrap the UPDATE queries in a transaction and then roll it back — that way, the queries still execute, but the state doesn’t change. Is this the right way to go? Does rollback introduce any performance overhead that would skew my results? Are there better or more realistic alternatives that simulate the full write path without persisting changes?

Thanks in advance!

Comments

sargstuff•9mo ago
pgbench[2] / pgreplay-go[0] / python locust[1]

very old school approach:

Misuse sql VIEW[3][4] to generate a temporary parallel table setup. Testing database separate from production database would be 'better', IMHO.

-----

[0] pgreplay-go : https://github.com/gocardless/pgreplay-go

[1] python locust : https://miguel-codes.medium.com/unconventional-load-testing-...

[2] pgbench load testing :

   a) https://medium.com/@c.ucanefe/pgbench-load-test-166bdfb5c75a

   b) https://neon.tech/blog/autoscaling-in-action-postgres-load-testing-with-pgbench

   c) https://hackernoon.com/how-to-create-and-load-test-data-in-postgresql-i41e353m
----------------------------

[3] : a) https://hashrocket.com/blog/posts/materialized-view-strategi...

      b) https://tech.jonathangardner.net/wiki/PostgreSQL/Materialized_Views

      c) https://stackoverflow.com/questions/77603705/what-is-the-use-of-materialized-view-in-postgresql
[4] : https://en.wikipedia.org/wiki/View_(SQL)
LawZiL•9mo ago
but again, how can i perform the query, but not actually change the state, i really need the state to keep untouched, but be able to perform the query itself.
MatthiasPortzel•9mo ago
> Does rollback introduce any performance overhead that would skew my results?

I would expect it to be the other way around—since the transactions are rolled back and not committed, they would have significantly less performance impact. But I’m working from an academic model of the database.

apothegm•9mo ago
Load test against a clone instead of a DB whose contents you care about?

LLM Integrity During Inference in Llama.cpp

https://bednarskiwsieci.pl/en/blog/integrity-llm-inference-tampering/
1•piotrbednarsalt•2m ago•1 comments

The iPhone 17e

https://daringfireball.net/2026/03/the_iphone_17e
1•chmaynard•4m ago•0 comments

The Requirements Layer Your AI System Is Missing

https://kiln.tech/blog/requirements_layer_your_ai_system_is_missing
1•samfierro•5m ago•1 comments

Simulating Catalog and Table Conflicts in Iceberg

https://cdouglas.github.io/posts/2026/03/catalog
1•eatonphil•9m ago•0 comments

Run PostgreSQL on AKS High‑Performance, Flexible, Cloud Native Postgres on Azure [video]

https://www.youtube.com/watch?v=KEApG5twaA4
1•RaouleDuke•9m ago•0 comments

Show HN: OxiGDAL – A pure Rust replacement for GDAL with zero C/C++ dependencies

https://github.com/cool-japan/oxigdal
1•kitasan•11m ago•0 comments

Newcomb's Paradox Needs a Demon

https://samestep.com/blog/newcombs-paradox/
1•sestep•11m ago•0 comments

ClaudeAI's Review of "Do Androids Dream of Electric Sheep"

https://old.reddit.com/r/ClaudeAI/comments/1rnio7s/had_claude_read_do_androids_dream_of_electric/
1•lisper•13m ago•0 comments

GPS jamming: The invisible battle in the Middle East

https://www.bbc.com/news/articles/c3ewwlx9e1xo
1•1659447091•14m ago•0 comments

Moonforge: A Yocto-Based Linux OS

https://www.igalia.com/2026/03/09/Introducing-Moonforge-A-Yocto-Based-Linux-OS.html
2•microflash•14m ago•0 comments

Lucid Dreaming (1995)

https://www.aphextwin.nu/learn/98336584377199.shtml
1•carlos-menezes•16m ago•0 comments

DuckDB 1.5.0

https://duckdb.org/2026/03/09/announcing-duckdb-150
2•erikcw•16m ago•0 comments

ChatJC – chatbot for resume/LinkedIn/portfolio info

https://joshuacurry.dev/
2•ogou•20m ago•1 comments

FreeBSD 14.4-Release Announcement

https://www.freebsd.org/releases/14.4R/announce/
2•todsacerdoti•21m ago•0 comments

AgentOps – The Discipline That Didn't Exist Last Year

https://doneyli.substack.com/p/agentops-the-discipline-that-didnt
1•hn247dj•21m ago•0 comments

It looks like the “JVG algorithm” only wins on tiny numbers

https://scottaaronson.blog/?p=9615
5•jhalderm•22m ago•0 comments

I built an app to replace the DAGR – $3.99 instead of $2,500

https://github.com/RedGridTactical/RedGridMGRS
1•redgridtactical•24m ago•1 comments

Convert Any API Documentation into a CLI for AI Agents

https://github.com/giorgioleonardi/pug
2•giorgiolc•28m ago•1 comments

Many US states planning or have operating system age verification laws

https://www.gamingonlinux.com/2026/03/many-more-us-states-are-planning-or-already-have-operating-...
3•20after4•29m ago•0 comments

A retention mechanic for intrinsic learning that isn't Duolingo manipulation?

https://www.dailylabs.co/
1•aidanadd•31m ago•1 comments

Xkcd: Change in Slope

https://xkcd.com/2701/
4•ravenical•37m ago•2 comments

TLAi+ Benchmarks for Evaluating LLMs

https://github.com/tlaplus/TLAiBench
2•alhazrod•38m ago•0 comments

The Unison Language – The Big Idea

https://www.unison-lang.org/docs/the-big-idea/
3•deterministic•40m ago•0 comments

Two Years of Emacs Solo: 35 Modules, Zero External Packages, and a Full Refactor

https://www.rahuljuliato.com/posts/emacs-solo-two-years
6•celadevra_•41m ago•0 comments

Anthropic sues Pentagon claiming supply chain risk label could cost billions

https://www.ft.com/content/af404e0a-7abc-49bc-9584-cd4690152f86
2•Jimmc414•42m ago•1 comments

Iran's attacks on Amazon data centers in UAE, Bahrain signal a new kind of war

https://fortune.com/2026/03/09/irans-attacks-on-amazon-data-centers-in-uae-bahrain-signal-a-new-k...
15•rawgabbit•46m ago•4 comments

I will pay you if you ship a bug

https://www.getautonoma.com
1•Escafati•48m ago•2 comments

Trump says Iran war is 'complete, pretty much'

https://www.theguardian.com/world/2026/mar/09/us-israel-strikes-iran-supreme-leader
3•hedayet•50m ago•1 comments

Anti-stringing device for a coin acceptor (1996)

https://patents.google.com/patent/US5511645A/en
2•exvi•51m ago•0 comments

Sally, by Isaac Asimov (1953)

https://lecturia.org/en/short-stories/isaac-asimov-sally/8602/
2•antognini•51m ago•0 comments