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?

The Manufacturing of Novelty

https://www.ft.com/content/99711b1a-3e54-4349-9c81-769cf7c96b97
1•JumpCrisscross•43s ago•0 comments

Probabilistic data structures in Go, part 2

https://antonz.org/probabilistic-data-structures-2/
1•mfrw•50s ago•1 comments

California train burglars carefully executed heists for 'staggering' $22M haul

https://www.theguardian.com/us-news/2026/nov/21/california-arrests-train-heists
2•ljf•3m ago•0 comments

Ask HN: Who Owns API Drift

1•Nalin_2408•5m ago•0 comments

Can Psychedelics Improve Decision-Making?

https://nautil.us/can-psychedelics-improve-decision-making-1286863
1•the-mitr•12m ago•0 comments

The Engineering Manager's role is under attack (again)

https://www.manager.dev/newsletter/the-engineering-manager-s-role-is-under-attack-again
1•fagnerbrack•16m ago•0 comments

Ask HN: Is Anthropic being public better or worse for your org?

3•ares623•17m ago•0 comments

Web Search on Amazon Bedrock expands language support and country-aware search

https://aws.amazon.com/about-aws/whats-new/2026/11/web-search-amazon-bedrock/
1•yackrru•22m ago•0 comments

Notes on the discrete Fourier transform (DFT)

https://eli.thegreenplace.net/2026/notes-on-the-discrete-fourier-transform-dft/
4•kouosi•25m ago•0 comments

Show HN: App Pixel3D – Dream to 3D Reality

https://apps.apple.com/hu/app/pixel3d-dream-to-3d-reality/id6479245806
1•cflsdf•25m ago•0 comments

Postgres 19 is out: try it on Neon

https://neon.com/blog/postgres-19-is-out-try-it-on-neon
2•yackrru•26m ago•0 comments

Show HN: iOS App Dancing Particle is an interactive app

https://apps.apple.com/us/app/dancing-particle/id6444665083
1•cflsdf•26m ago•0 comments

Amazon is complaining about NYC Council on shipping labels, too

https://www.theverge.com/tech/1039564/amazon-nyc-council-packages-shipping-label
2•burnt-resistor•31m ago•0 comments

Show HN: Prompt Upgrader – a no-signup tool that scores and rewrites AI prompts

https://madgpt1.github.io/prompt-upgrader/
1•MadGPT•36m ago•0 comments

AI resolved all null pointer dereferences in C

https://kapteko.com/ai-resolved-all-null-pointer-dereferences/
1•fessguid•40m ago•1 comments

The Indignity of Makework

https://poisonandoak.wordpress.com/2026/11/21/the-indignity-of-makework/
1•wburglett•47m ago•0 comments

IronWAL: High performance, high durability, deterministic WAL

https://github.com/excsn/ironwal
1•excsn•53m ago•1 comments

How to read a CVSS score and decide what to patch

https://p99log.com/reading-cvss-scores/
1•collinstonui•56m ago•0 comments

Why agent swarms get better at optimizing code as they grow

https://frontier.replit.com/throwing-headcount-at-the-problem/
2•DonAtimator•57m ago•0 comments

Stephen Wolfram "Live CEOing" videos of Wolfram Language feature development

https://www.youtube.com/playlist?list=PLxn-kpJHbPx14mHrB5BlhImVOWo5Geg6f
1•alok-g•1h ago•0 comments

OpenRouter requests to MiniMax models may have been read

https://www.reddit.com/r/LocalLLaMA/comments/1y1we95/openrouter_requests_to_minimax_models_may_have/
2•ksec•1h ago•0 comments

AWS local emulator created by AI agents

https://aws.amazon.com/blogs/aws/test-your-applications-against-aws-locally-with-aws-emulator/
2•wenbert•1h ago•0 comments

The quantum computing race is becoming a deployment race

https://www.techradar.com/pro/the-quantum-computing-race-is-becoming-a-deployment-race
3•jonbaer•1h ago•0 comments

'I was shaking, crying, having trouble breathing': the uncharted trauma

https://www.theguardian.com/technology/ng-interactive/2026/nov/21/shaking-crying-trouble-breathin...
1•user20180120•1h ago•1 comments

Show HN: The Riemann Proof Handbook

https://github.com/tamnd/riemann-handbook
11•tamnd•1h ago•3 comments

WikiLLM: Browse language model weights like an encyclopedia

https://github.com/eagleclaw0075/wikillm/
2•havemurci•1h ago•0 comments

Show HN: Npx.tools, a keyboard-friendly index of developer tools

https://npx.tools/
1•hasnainkhagan•1h ago•0 comments

AI as a Lifestyle Choice

https://grahamdumpleton.me/posts/2026/11/ai-as-a-lifestyle-choice/
1•Karrot_Kream•1h ago•0 comments

California Nvidia Probe Covers Potential Criminal Law Violations

https://www.bloomberg.com/news/articles/2026-11-21/california-nvidia-probe-covers-potential-crimi...
3•petethomas•1h ago•0 comments

Ask HN: What made you pivot your interest to the field of AI?

5•learner_yearner•1h ago•4 comments