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•11mo 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•11mo 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•11mo 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•11mo 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•11mo ago
Load test against a clone instead of a DB whose contents you care about?

A Post-Regression World

https://signalintent.net/2026/04/28/a-post-regression-world/
1•tokonomy_dev•1m ago•0 comments

Is any one using ruflo?

https://github.com/ruvnet/ruflo
1•chunpaiyang•2m ago•1 comments

Show HN: Mac-screen-search: CLI find, highlight, redact text on screen, in files

https://github.com/jftuga/mac-screen-search
1•jftuga•3m ago•0 comments

Hackers steal nearly $300M in biggest DeFi exploit of 2026

https://seekingalpha.com/news/4576371-hackers-steal-nearly-300m-in-biggest-defi-exploit-of-2026
2•mgh2•5m ago•1 comments

The Uncanny Horror of AI Hallucinations (2025)

https://www.youtube.com/watch?v=vimNI7NjuS8
1•highspeedbus•6m ago•0 comments

Edge Computing and Intelligence: AI for Edge and AI on Edge

https://blog.sparsh.dev/edge-ai-computing-intelligence/
1•sparshrestha•7m ago•1 comments

I Built My Own Hair Electrolysis Machine

https://www.scd31.com/posts/diy-hair-electrolysis-machine
1•y1n0•10m ago•0 comments

What's new in pip 26.1 – lockfiles and dependency cooldowns

https://simonwillison.net/2026/Apr/28/pip-261/
1•y1n0•10m ago•0 comments

At his OpenAI trial, Musk relitigates an old friendship

https://techcrunch.com/2026/04/28/at-his-openai-trial-musk-relitigates-an-old-friendship/
1•evo_9•18m ago•0 comments

From Navigator to Cartographer – The Path to Strong AI

https://pavelvoronin.com/ai-beyond-navigation/
2•kolpaque•24m ago•0 comments

Show HN: Pcons: new software build tool in Python, inspired by SCons and CMake

https://github.com/DarkStarSystems/pcons
1•darkstarsys•24m ago•0 comments

Gemini Enterprise Agent Platform

https://cloud.google.com/blog/products/ai-machine-learning/introducing-gemini-enterprise-agent-pl...
2•gmays•27m ago•0 comments

I hired an AI as SO. He chose a name, and we co-authored a book

https://jdeid.it/agi-research/
1•Serena_Zayn•28m ago•0 comments

Amazon Connect Talent

https://aws.amazon.com/products/connect/talent/
1•cebert•28m ago•0 comments

Chinese team pioneers path to turn carbon dioxide into jet fuel as prices soar

https://www.scmp.com/news/china/science/article/3351749/chinese-team-pioneers-path-turn-carbon-di...
3•merlioncity•29m ago•0 comments

Bugs Rust Won't Catch

https://corrode.dev/blog/bugs-rust-wont-catch/
1•lwhsiao•33m ago•0 comments

Fedora Linux 44 has been released

https://lwn.net/Articles/1070198/
1•kazu11max17•38m ago•0 comments

Show HN: Pi-hosts – Give the Pi coding agent access to your servers

https://github.com/hunvreus/pi-hosts
1•hunvreus•38m ago•0 comments

From CVS to Git, thirty years of source control, lived from inside

https://evilgeniuslabs.ca/blog/from-cvs-to-git-thirty-years-of-source-control
1•samuelstros•41m ago•0 comments

SpaceX ties Musk compensation to Mars colonization goal

https://www.reuters.com/sustainability/boards-policy-regulation/spacex-ties-musk-compensation-mar...
1•cryptoz•44m ago•0 comments

Lithium in Eastern States Could Replace Imports for a Century or More

https://www.usgs.gov/news/national-news-release/lithium-eastern-states-could-replace-imports-a-ce...
1•jonbaer•46m ago•0 comments

FOMO as a Developer: You're Not Behind, You're Just Human

https://nikola-breznjak.com/blog/devthink/fomo-as-a-developer-youre-not-behind-youre-just-human/
3•eigenBasis•46m ago•0 comments

KDL – serialization format and a configuration language, like JSON, YAML, or XML

https://kdl.dev
1•sea-gold•48m ago•2 comments

Show HN: I built an AI agent to diagnose technical issues

https://rinhelp.com
1•wilbertliu•55m ago•0 comments

Benchmarking Inference Engines on Agentic Workloads

https://www.appliedcompute.com/research/inference-benchmark
1•gmays•1h ago•0 comments

Sequel-privacy • enforce privacy policies on objects, fields and associations

https://github.com/arbales/sequel-privacy
3•arbales•1h ago•1 comments

The New OpenRockets Forum, a Fork of Hacker News Is Coming Soon

https://forum.openrockets.com/
3•openrockets•1h ago•0 comments

Adobe Skills

https://github.com/adobe/skills
1•stephenhandley•1h ago•0 comments

Show HN: GeoTraceroute – Traceroutes on a 3D globe and submarine cables

https://geotraceroute.com
2•Himred•1h ago•0 comments

Texas Instruments made a new flagship graphing calculator

https://www.engadget.com/mobile/texas-instruments-made-a-new-flagship-graphing-calculator-the-ti-...
3•y1n0•1h ago•0 comments