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

Virtual Reality Tool May Offer Easier Vision Testing, Early Research Shows

https://news.cuanschutz.edu/ophthalmology/virtual-reality-eye-research-geographic-atrophy
1•PaulHoule•58s ago•0 comments

Meta Is Killing Messenger Desktop Apps PWAs Are Finally Taking Over?

https://www.cnet.com/tech/services-and-software/meta-is-shutting-down-its-mac-and-windows-messeng...
1•birdculture•2m ago•0 comments

₿OSS Challenge 2026 – Start Your Career in Bitcoin Open Source Software

https://bosschallenge.xyz
1•jrakibi•2m ago•1 comments

A fentanyl vaccine is about to get its first major test

https://www.wired.com/story/a-fentanyl-vaccine-is-about-to-get-its-first-major-test/
1•jnord•3m ago•0 comments

Siray ComfyUI Nodes

https://github.com/siray-ai/siray-comfyui
1•wangrzneu•5m ago•0 comments

ConcoLLMic: Agentic Concolic Execution

https://concollmic.github.io/
1•ecares•5m ago•0 comments

Website unresponsive: diagnostic steps and blocking the AI crawlers

https://physicsderivationgraph.blogspot.com/2025/12/website-unresponsive-diagnostic-steps.html
1•physicsgraph•9m ago•1 comments

Modular Monolith and Microservices: Data ownership, boundaries and consistency

https://binaryigor.com/modular-monolith-and-microservices-data.html
1•BinaryIgor•11m ago•0 comments

Compensate for Rockchip calendar deviation on November 31st

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f076ef44a44d02ed915...
1•rlpb•13m ago•0 comments

Turing Awardees Republished Key Methods Whose Creators They Failed to Credit

https://people.idsia.ch/~juergen/ai-priority-disputes.html
1•tamnd•14m ago•0 comments

I Ignore the Spotlight as a Staff Engineer

https://lalitm.com/software-engineering-outside-the-spotlight/
2•todsacerdoti•15m ago•0 comments

SereneDB Secures $2.1M to Challenge the Status Quo of Search and Analytics

https://www.serenedb.com/blog/
1•ashvardanian•17m ago•0 comments

Brave vs. Firefox – Brave

https://brave.com/compare/firefox-vs-brave/
2•kirillrogovoy•17m ago•0 comments

Show HN: FiliGrid – A daily word association puzzle

https://filigrid.com
1•ikolding•17m ago•0 comments

30 years ago today "Netscape and Sun announce JavaScript"

https://web.archive.org/web/20070916144913/http://wp.netscape.com/newsref/pr/newsrelease67.html
4•donohoe•20m ago•1 comments

The Forge Calculator

https://forge-calculator.com/
1•GINGINli•21m ago•0 comments

How A Man Convicted of Running a Latin American Narco State Landed a Pardon

https://www.wsj.com/politics/policy/how-a-man-convicted-of-running-a-latin-american-narco-state-l...
3•Anon84•21m ago•1 comments

Show HN: I built a game where you race from one side of the world to the other

https://geo-racers.com/
3•pattle•22m ago•1 comments

Tracker AI – A Veterinary LLM Trained on 300k+ Clinical Cases

https://www.trackerai.ai/
2•Taz-Ai•23m ago•2 comments

Show HN: GridSport.Games – Daily football/soccer trivia (PWA, 12 languages)

https://gridsport.games/en
1•Kovacbb•24m ago•0 comments

Einstein Would Be Rejected Today:Why We Need a Cognitive Paradigm Nuclear Fusion

https://medium.com/@zaranur848/at-this-very-moment-billions-of-genius-concepts-are-dissipating-li...
1•haizei•25m ago•0 comments

Two Virginia Men Arrested for Conspiring to Destroy Government Databases

https://www.justice.gov/opa/pr/two-virginia-men-arrested-conspiring-destroy-government-databases
1•davikr•27m ago•0 comments

Ask HN: Is there any award for having a failing streak?

1•sahil423•28m ago•1 comments

Show HN: InkStats – AI vs. AI Simulator for Disney Lorcana Decks

https://inkstats.app/
1•RPeres•28m ago•0 comments

Show HN: AI Image Generation Boilerplate (Next.js and Supabase and Stripe)

https://lacy-yoke-439.notion.site/PlutoSaaS-Build-Your-AI-Image-SaaS-in-Minutes-eeae4c7f9f1c42e59...
2•4htmlgames•29m ago•0 comments

PaperDebugger: A Plugin-Based Multi-Agent System for In-Editor Academic Writing

https://arxiv.org/abs/2512.02589
1•Anon84•30m ago•0 comments

Includetheprompt.com

https://includetheprompt.com
1•sunaurus•35m ago•1 comments

Making Sense of Memory in AI Agents

https://www.leoniemonigatti.com/blog/memory-in-ai-agents.html
3•sebg•36m ago•0 comments

Google insider profited $1M in a single day betting on the Google search markets

https://twitter.com/JeongHaeju/status/1996462116094480464
2•mirzap•36m ago•0 comments

NextJS Security Vulnerability

https://nextjs.org/blog/CVE-2025-66478
7•connor11528•38m ago•0 comments