frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

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

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

PHP is Dead (and AI is to blame)

https://www.lifeofguenter.de/2026/09/php-is-dead-and-ai-is-to-blame
1•lifeofguenter•2m ago•0 comments

Show HN: Impress your boss with interactive Scikit-Learn Decision Tree

https://github.com/mljar/supertree
1•pplonski86•4m ago•0 comments

What makes $BigTechCompany's products bad, anyway?

https://herecomesthemoon.net/2026/09/why-is-big-tech-bad/
1•birdculture•6m ago•0 comments

Show HN: Project Estimator – a free, no sign-up software cost estimator

https://project-estimator.webround.net/
1•LucaSiviero•7m ago•0 comments

US claims Chinese AI firms are carrying out 'industrial-scale' theft

https://www.cnn.com/2026/09/08/politics/us-accuses-china-of-stealing-ai-technology
1•jllyhill•7m ago•0 comments

Primework by Kunst X

https://kunstx.online/primework/
2•kunstx•7m ago•1 comments

Bristol Myers' blood cancer cell therapy succeeds in mid-stage trial

https://www.reuters.com/business/healthcare-pharmaceuticals/bristol-myers-blood-cancer-cell-thera...
1•thunderbong•8m ago•0 comments

How Much of the Internet Is Written with AI?

https://www.pewresearch.org/data-labs/2026/08/20/how-much-of-the-internet-is-written-with-ai/
1•dp-hackernews•8m ago•0 comments

Steam now requires Australian users to verify their age with a credit card

https://www.reddit.com/r/Games/comments/1wbauz5/steam_now_requires_australian_users_to_verify/
1•haunter•8m ago•0 comments

Show HN: CreepyLink: A fun tool to turn safe URLs into suspicious looking links

https://www.creepylink.online
1•tangjei•11m ago•0 comments

Law schools tell students to put AI away

https://www.ft.com/content/8ddd3668-5858-45c3-b34f-a6bafc678187
4•1vuio0pswjnm7•13m ago•0 comments

Our Technological Wager

https://dissentmagazine.org/article/artificial-futures-ai-risk/
1•robtherobber•16m ago•0 comments

Italian tech collective Autistici/Inventati shut down by Trump administration

https://sabot.media/post/ai-shuts-down
2•kYuZz•17m ago•1 comments

ScanChess – Digitize handwritten chess scorebooks and diagrams into PGN/FEN

https://scanchess.com/
1•sudoai•20m ago•0 comments

Want to borrow a dinosaur fossil? Try California's taxidermy lending library

https://www.theguardian.com/us-news/2026/sep/08/san-diego-taxidermy-museum
1•rdmuser•21m ago•0 comments

Ryanair ATC disruption update with Synthesia AI representative [video]

https://www.youtube.com/shorts/pIfAvoHtj44
2•50kIters•22m ago•1 comments

The diversity hypothesis: diversity and scientific output/impact in the sciences

https://link.springer.com/article/10.1007/s11186-026-09714-x
2•mpweiher•22m ago•0 comments

Show HN: Compute Polynomials Twice as Fast

https://thomasahle.com/fast-polynomials/
1•thomasahle•22m ago•0 comments

The Fundamental Limits of LLMs at Scale

https://openreview.net/pdf?id=BIRDGVrom8
1•leeuw01•23m ago•0 comments

Diskless Kafka: Object Storage, KIP-1150, and Kafka's Future

https://softwaremill.com/diskless-kafka-object-storage-kip-1150-and-kafkas-future/
1•mmatloka•30m ago•0 comments

Gambling with our lives: AI researcher quits Anthropic with warning about safety

https://www.politico.eu/article/anthropic-openai-researcher-jacob-coxon-warns-ai-could-kill-humans/
2•taubek•33m ago•0 comments

Arm's C2-Ultra, G2-Ultra NX, and CSS N4 IP

https://chipsandcheese.com/p/arms-c2-ultra-g2-ultra-nx-and-css
1•rbanffy•33m ago•0 comments

Google warns lower quality as it revamps Europe search results to avoid EU fines

http://www.reuters.com/world/google-warns-lower-quality-it-revamps-europe-search-results-avoid-eu...
2•1vuio0pswjnm7•33m ago•0 comments

Bitap: My favorite string matching algorithm

https://jo3-l.dev/posts/bitap/
1•fanf2•34m ago•0 comments

CogniFind is now available for Windows

https://www.cognifind.co/
1•hisp•34m ago•1 comments

If I wanted to maximize AI risk

https://twitter.com/kellerjordan0/status/2097526284918419662
1•tosh•38m ago•0 comments

Building Jarvis: a better voice starts before training

https://fpl.dev/post/building-jarvis-tts-and-dataset-studio/
1•ajmwagar•41m ago•1 comments

Rails devs: heads up on JSON 3.0 gem

https://github.com/rails/rails/issues/58685
1•jjgreen•41m ago•1 comments

Teleporting ":3" – an introduction to quantum computing

https://blog.teddy55.com/Posts/24.06/quantum-computing-with-qsharp
1•Teddy__•49m ago•0 comments

People are more likely to ditch the car and use an e‑bike if they feel safe

https://theconversation.com/people-are-more-likely-to-ditch-the-car-and-use-an-e-bike-if-they-fee...
2•robtherobber•49m ago•0 comments