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?

IDF to receive 'Iron Beam' laser interceptors at the end of the month

https://www.timesofisrael.com/idf-to-receive-iron-beam-laser-interceptors-at-the-end-of-the-month/
1•mhb•18s ago•0 comments

Cartographers Have Been Hiding Covert Illustrations Inside of Switzerland's Maps

https://eyeondesign.aiga.org/for-decades-cartographers-have-been-hiding-covert-illustrations-insi...
1•mhb•1m ago•0 comments

How do lava lamps help with encryption?

https://www.cloudflare.com/learning/ssl/lava-lamp-encryption/
1•susam•2m ago•0 comments

A $100K Robot Dog Is Becoming Standard in Policing – and Raising Ethical Alarms

https://www.bloomberg.com/news/articles/2025-11-18/boston-dynamic-robot-dogs-increasingly-used-by...
2•mhb•2m ago•1 comments

Trailblazing scheme to reconnect thousands with HIV treatment

https://www.gov.uk/government/news/trailblazing-scheme-to-reconnect-thousands-with-hiv-treatment
1•robin_reala•3m ago•0 comments

Lotto Analyzer (beta test with Loto France)

https://lottoanalyzer.fr/
1•netfortius•4m ago•0 comments

Launching DeepSeek-v3.2 and DeepSeek-v3.2-Speciale

https://twitter.com/deepseek_ai/status/1995452641430651132
1•willahmad•4m ago•0 comments

STPA for Software Systems–Illuminate the Unknown Unknowns

https://www.usenix.org/conference/srecon25emea/presentation/klein
1•motxilo•5m ago•0 comments

AI video slop is everywhere, take our quiz to try and spot it

https://www.npr.org/2025/11/30/nx-s1-5610951/fake-ai-videos-slop-quiz
3•alpha_squared•5m ago•0 comments

Deep Thoughts Engineering Speaker Series: John Carmack (2020) [video]

https://www.youtube.com/watch?v=dSCBCk4xVa0
1•tosh•7m ago•0 comments

Why is there so little GenAI content if I use the small web filter?

https://hcker.news/?smallweb=true
1•com•8m ago•1 comments

Farewell for Now, Chrome

https://addyosmani.com/blog/farewell-chrome/
1•janpio•9m ago•0 comments

DeepSeek-v3.2: Pushing the Frontier of Open Large Language Models

https://cas-bridge.xethub.hf.co/xet-bridge-us/692cfec93b25b81d09307b94/2d0aa38511b9df084d12a00fe0...
2•BoorishBears•9m ago•1 comments

Zo: Personal Servers for Everyone

https://zocomputer.com
1•benzguo•10m ago•0 comments

A vector graphics workstation from the 70s

https://justanotherelectronicsblog.com/?p=1429
1•ibobev•10m ago•0 comments

Ask HN: Parent wants to learn ML and World models, where do I start?

1•throwaw12•11m ago•0 comments

Tenderlove Making – Seattle Downtown Library

https://tenderlovemaking.com/shots/2025-11-30-public-library/
1•ibobev•12m ago•0 comments

Faster comparison modulo α-equivalence

https://purplesyringa.moe/blog/faster-comparison-modulo-alpha-equivalence/
1•ibobev•12m ago•0 comments

Show HN: ZkMesh – federated ZK bot mitigation

https://github.com/throwawayaway45/zkMesh
1•throwawayaway45•13m ago•0 comments

WhatsApp will become interoperable with other messaging apps

https://tuta.com/blog/whatsapp-interoperable-in-europe
7•marvinborner•18m ago•2 comments

New AI could teach the next generation of surgeons

https://hub.jhu.edu/2025/12/01/artificial-intelligence-trains-surgeons/
2•geox•20m ago•0 comments

Vertical Integration Allows US Insurers to Bypass the 85% Profit Cap

https://taprootlogic.substack.com/p/the-1997-mistake-part-3-why-fixing
2•kmundy•22m ago•1 comments

Epstein email exchanges planned Wikipedia strategy, edits and reported progress

https://en.wikipedia.org/wiki/Wikipedia:Wikipedia_Signpost/2025-12-01/Disinformation_report
1•akolbe•22m ago•0 comments

A Flicker Free Fix for LED Holiday Lights

https://www.instructables.com/A-Flicker-Free-Fix-for-LED-Holiday-Lights/
1•cardamomo•22m ago•0 comments

Panoramic Image Driven Point Cloud Initialization for 3D Reconstruction

https://www.mdpi.com/1424-8220/25/22/6840
2•PaulHoule•23m ago•0 comments

Constructing the Word's First JPEG XL MD5 Hash Quine

https://stackchk.fail/blog/jxl_hashquine_writeup
2•todsacerdoti•24m ago•0 comments

Advent of Svelte 2025

https://advent.sveltesociety.dev/2025
1•CommonGuy•25m ago•0 comments

Google deletes X post after getting caught using a stolen AI recipe infographic

https://www.bleepingcomputer.com/news/artificial-intelligence/google-deletes-x-post-after-getting...
4•jinxmeta•25m ago•0 comments

Medley Interlisp for the Newcomer

https://primer.interlisp.org
1•todsacerdoti•26m ago•0 comments

Building effective enterprise agents [pdf]

https://www.bcg.com/assets/2025/building-effective-enterprise-agents.pdf
1•eikendev•27m ago•0 comments