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

Evan You shows VOID: Vite-native deployment platform [video]

https://www.youtube.com/watch?v=Bp86buftbX8
1•CharlesW•32s ago•0 comments

Digg: A Hard Reset, and What Comes Next

https://digg.com/
1•pavel_lishin•2m ago•0 comments

Florida's New "Thought Police" Bill Is Real (HB 945) [video]

https://www.youtube.com/watch?v=9wjnBWnL8bM
1•hrimfaxi•2m ago•1 comments

AI engineer uses ChatGPT+AlphaFold to develop cancer vaccine for his dog

https://www.theaustralian.com.au/business/technology/tech-boss-uses-ai-and-chatgpt-to-create-canc...
3•bensandcastle•4m ago•1 comments

Right to Compute Act (NH HB1124)

https://legiscan.com/NH/text/HB1124/id/3286560
1•maxwell•6m ago•0 comments

GitHub infuriates students by removing some models from free Copilot plan

https://www.theregister.com/2026/03/13/microsoft_github_removes_models_student_plan/
2•raybb•9m ago•0 comments

Who Goes Nazi? (1941)

https://harpers.org/archive/1941/08/who-goes-nazi/
4•Anon84•10m ago•0 comments

Reverse-engineering Claude's generative UI – then building it for the terminal

https://michaellivs.com/blog/reverse-engineering-claude-generative-ui/
1•gmays•10m ago•0 comments

coming soon: fashion critique newsletter

https://igasped.substack.com/about
2•kholiflower•12m ago•1 comments

Show HN: I save £300/mo by auto-scaling my staging cluster at night

https://github.com/tiny-systems/desktop-client
1•gtpoxa•13m ago•0 comments

Claude Visual and Interactive Content

https://support.claude.com/en/articles/13641943-visual-and-interactive-content
1•droidjj•14m ago•0 comments

Accidental complexity, essential complexity, and Kubernetes (2022)

https://jamsocket.com/blog/complexity-kubernetes
1•Tomte•16m ago•0 comments

US Gas spending increase since Feb 28

https://gas-cost-of-iran-war.netlify.app/
1•loss_flow•16m ago•2 comments

Show HN: DJX – Convention over Configuration for Django (Rails-Inspired CLI)

2•RedsonNgwira•16m ago•0 comments

Waller: A game teaching the fundamentals of drystone walling

https://www.orthodoxmasonry.com/waller
2•CGMthrowaway•17m ago•0 comments

How do you capture WHY engineering decisions were made, not just what?

6•zain__t•20m ago•6 comments

Hawkeye – open-source flight recorder

2•mklamine•20m ago•1 comments

Another AT&T FirstNet user gets $6,200 bill, at $2 per megabyte

https://arstechnica.com/tech-policy/2026/03/att-wrongly-charged-man-6196-reversed-bill-after-hear...
3•mounram•21m ago•0 comments

Datacenters are becoming a target in warfare for the first time

https://www.theguardian.com/technology/2026/mar/10/datacenters-target-warfare-iran
3•mizzao•22m ago•0 comments

Amazon customers hate Alexa's new, adults-only 'Sassy' voice: 'Unplug'

https://nypost.com/2026/03/13/tech/amazon-customers-hate-alexas-new-adults-only-sassy-voice/
3•1vuio0pswjnm7•23m ago•0 comments

Learn Haskell in Two Weeks

https://vitez.me/learn-haskell-in-two-weeks
1•mitchellvitez•24m ago•0 comments

How Google is reimagining Maps with Gemini

https://blog.google/products-and-platforms/products/maps/ask-maps-immersive-navigation/
3•gmays•24m ago•0 comments

There's a Class 100 semiconductor cleanroom inside this backyard shed [video]

https://www.youtube.com/watch?v=HfSO-LCKmrA
1•bwidlar•25m ago•0 comments

Adobe settles DOJ cancellation fee lawsuit, will pay $75M penalty

https://arstechnica.com/gadgets/2026/03/adobe-settles-doj-cancellation-fee-lawsuit-will-pay-75-mi...
1•mounram•26m ago•0 comments

Lightweight Kanban board for Claude Code

https://runnrr.io/landing
1•dvitjazevs•27m ago•1 comments

After Amazon's Alexa asks creepy questions to tot, Mom pulls plug

https://nypost.com/2026/03/11/lifestyle/amazons-alexa-asked-my-4-year-old-girl-this-creepy-questi...
2•1vuio0pswjnm7•28m ago•0 comments

Three-Dimensional Bioprinting and Rose-Inspired Medical Applications

https://www.mdpi.com/2313-7673/11/3/164
1•PaulHoule•29m ago•0 comments

Analysis of hydrogen production costs by various methods (2022)

https://www.sciencedirect.com/science/article/pii/S2666790822001574
2•zahlman•29m ago•1 comments

Show HN: Interview scoring app because our feedback was just Slack vibes

https://techscore.dev/
1•xaviair•31m ago•0 comments

The wild six weeks for NanoClaw's creator that led to a deal with Docker

https://techcrunch.com/2026/03/13/the-wild-six-weeks-for-nanoclaws-creator-that-led-to-a-deal-wit...
23•wateroo•32m ago•0 comments