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

Show HN: I built an API for agents visiting my personal website

https://mczaykowski.com/articles/smallest-ax-surface
1•selvmvde•1m ago•0 comments

SubQ – a major breakthrough in LLM intelligence

https://twitter.com/alex_whedon/status/2051663268704636937
1•vanni•1m ago•0 comments

WolfPSA: PSA Crypto Compatibility Powered by WolfCrypt

https://github.com/wolfSSL/wolfPSA
1•aidangarske•2m ago•0 comments

Testers – 12 Testers Community

https://play.google.com/store/apps/details?id=com.thardstudio.testers&hl=en_US
1•mdaside•2m ago•1 comments

Ask HN: What tech hobbies are worth exploring?

1•merek•3m ago•0 comments

ArkTunnel, censorship-resistant tunnel that hides behind a real Bitcoin node

https://github.com/st-hannibal/ArkTunnel
1•st-hannibal•3m ago•0 comments

Peter Thiel on the Future of Legal Technology – Notes Essay (2012)

https://www.tumblr.com/blakemasters/37411481044/peter-thiel-on-the-future-of-legal-technology
1•ronfriedhaber•4m ago•0 comments

2026 Puzzle Design Competition: Entries

https://puzzleworld.org/DesignCompetition/2026/
1•robinhouston•4m ago•0 comments

Google, xAI and Microsoft agree to US national security reviews of new AI models

https://www.ft.com/content/c4435dd4-00c0-4270-aab9-3c7ce1ae45f6
1•merksittich•5m ago•0 comments

Show HN: Why Two Identical PDFs Have Different SHA-256 Hashes (How We Fixed It)

https://docs.pdfcanon.com/blog/why-identical-pdfs-hash-differently/
1•napzoom•7m ago•2 comments

Agent Orchestration Models

1•archer423•8m ago•0 comments

Wordy – Solving SEO Overkill with Information Theory and Stochastic Inference

https://wordy.runtime-hub.com/
1•RunTimeZero•10m ago•0 comments

Build you a personal assistant agent for fun and profit

https://techstackups.com/guides/build-personal-assistant-agent/
2•sixhobbits•11m ago•0 comments

Show HN: iOS SimulatorCamera – use your MacBook camera with iOS simulators

https://github.com/Akylas/SimulatorCamera
1•farfromrefuge•12m ago•0 comments

Achieving CVE Remediation in an Era of Escalating Vulnerabilities

https://flox.dev/blog/achieving-rapid-cve-remediation-in-an-era-of-escalating-vulnerabilities/
1•ronef•12m ago•1 comments

Show HN: Open-Source DesignMD Generator

https://www.designmd.supply/
2•ICodeSometimes•13m ago•0 comments

Offline Local AI for Protest

https://apps.apple.com/us/app/outcry-activist-ai-mentor/id6762086768
1•micahwhite•13m ago•0 comments

PageIndex: Vectorless, Reasoning-Based RAG

https://github.com/VectifyAI/PageIndex
1•garyclarke27•13m ago•0 comments

Don't Outsource Your Understanding

https://leehanchung.github.io/blogs/2026/05/01/dont-outsource-your-understanding/
1•freediver•14m ago•0 comments

BlueZ-powered Auracast broadcasting on Genio 700

https://www.collabora.com/news-and-blog/blog/2026/05/05/bluez-powered-auracast-broadcasting-on-ge...
2•losgehts•15m ago•1 comments

Single-layer transformer model "HarEmb" showcasing PII SOTA performance

https://huggingface.co/fblgit/haremb-privacy-filter-opennemo
1•fblgit•15m ago•1 comments

Peter Thiel backs $1B ocean data centre startup powered by waves

https://www.ft.com/content/711ce313-16fb-4a12-b6be-fbed547c8a39
1•1vuio0pswjnm7•15m ago•1 comments

Add Animal Crossing events to your digital calendar

https://sethmlarson.dev/animal-crossing-calendar
1•anujbans•16m ago•0 comments

Why Ancient Egyptian Honey Remains Edible After 3k Years

https://www.openculture.com/2026/05/why-ancient-egyptian-honey-remains-edible-after-3000-years.html
1•Brajeshwar•16m ago•0 comments

Show HN: Flow – Workflow automation that follows you across projects

https://github.com/flowexec/flow
2•Jahvon•17m ago•0 comments

Today I shipped 20 apps and a screensaver

https://blog.gingerbeardman.com/2026/04/17/today-i-shipped-twenty-apps-and-a-screensaver/
1•freediver•17m ago•0 comments

Three Inverse Laws of AI

https://susam.net/inverse-laws-of-robotics.html
4•blenderob•19m ago•0 comments

Agent guardrails are mostly theater

https://github.com/faramesh/faramesh-core
2•brian_r_hall•19m ago•0 comments

I'm a Doctor. Here's What A.I. Cannot Do

https://www.nytimes.com/2026/05/05/opinion/ai-doctor.html
1•pretext•19m ago•0 comments

The Value of Reliable Statistics

https://www.nber.org/papers/w35135
1•alphabetatango•21m ago•0 comments