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

Show HN: Discord CLI designed for agents to explore/read/send messages

https://github.com/famasya/discord-cli-agent
1•pacific01•5m ago•0 comments

Hide from Meta's spyglasses with this new Android app

https://www.theregister.com/2026/02/25/meta_smart_glasses_android_app/
1•zigmig•5m ago•0 comments

Russian mathematician finds new approach to 190-year-old 'eternal' math problem

https://www.msn.com/en-xl/science/mathematics/russian-mathematician-finds-new-approach-to-190-yea...
1•georgecmu•11m ago•0 comments

Tropical plants flowering months earlier or later because of climate crisis

https://www.theguardian.com/environment/2026/feb/25/tropical-plants-flower-shifted-months-climate...
2•andsoitis•13m ago•0 comments

Less is More when it comes to AI

https://www.bicameral-ai.com/blog/dogfood-bicameral
1•jinhkuan•14m ago•1 comments

The Remote-Work Dream Isn't Dead, but It's Slipping Away

https://www.wsj.com/lifestyle/careers/the-remote-work-dream-isnt-dead-but-its-slipping-away-a19ae9e8
2•RestlessMind•17m ago•0 comments

Show HN: Lingua Universale – session types and Lean 4 proofs for AI agents

https://github.com/rafapra3008/cervellaswarm
1•rafapra•18m ago•1 comments

Rising CO₂ and warming jointly limit phosphorus availability in rice soils

https://phys.org/news/2026-02-jointly-limit-phosphorus-availability-rice.html
1•PaulHoule•18m ago•0 comments

Show HN: Knox–Full Stack L1 Post-Quantum Privacy Crypto (Built with My 11yo)

https://github.com/ULT7RA/KNOXProtocol
1•KnoxProtocol•20m ago•0 comments

Show HN: Agentic Power of Attorney (APOA) – An open standard for AI agent auth

https://github.com/agenticpoa/apoa
1•juanfiguera•21m ago•0 comments

We left OpenAI because of safety

https://twitter.com/gothburz/status/2026810017593057739
2•mellosouls•21m ago•1 comments

Theory of Space

https://theory-of-space.github.io/
1•vinhnx•22m ago•0 comments

Divexa Exchange: Compliance in Low-Latency Systems

1•DanielOnBlock•22m ago•1 comments

Show HN: Right-click any text on macOS to add it to your calendar (open-source)

https://github.com/VimalMollyn/Right-Click-and-Add-to-Cal
1•mollynpaan•23m ago•0 comments

Show HN: Projekt – All-in-one workspace for building with agents

https://www.getprojekt.com/
1•bobbydotdesign•24m ago•0 comments

The Horrifying Truth Behind the 1990s Olestra Crisis

https://www.ranker.com/list/olestra-wow-chips-history-explained/jtdesaulnier
1•pkaeding•25m ago•0 comments

Add dormant user re-engagement email and improve name parsing

1•nishiohiroshi•27m ago•0 comments

Harness engineering: leveraging Codex in an agent-first world

https://openai.com/index/harness-engineering/
1•fmihaila•30m ago•0 comments

The man building Team USA's Olympic bobsleds

https://www.adirondackexplorer.org/community-news/people/lake-placid-man-builds-team-usas-olympic...
2•wrsh07•31m ago•0 comments

Ask HN: Apache prefork under crawler load – main domains OK, subdomains fail

1•PhongSGC•32m ago•1 comments

Schedule Recurring Tasks in Cowork

https://support.claude.com/en/articles/13854387-schedule-recurring-tasks-in-cowork
1•ed•32m ago•0 comments

Apple Foundation Models SDK for Python

https://github.com/apple/python-apple-fm-sdk
1•gok•36m ago•0 comments

Americans Are Leaving the U.S. in Record Numbers

https://www.wsj.com/us-news/americans-leaving-the-us-migration-a5795bfa
31•reaperducer•42m ago•7 comments

What I learned from 14,000 AI agent sessions

https://coasty.ai:443/
1•nkov47as•44m ago•1 comments

Why is your Mac WiFi Slow?

https://whyfi.network/
1•jamesgresql•47m ago•2 comments

Disrupting the Gridtide Global Cyber Espionage Campaign

https://cloud.google.com/blog/topics/threat-intelligence/disrupting-gridtide-global-espionage-cam...
1•0in•47m ago•0 comments

Code Is Cheap – Now What?

https://www.zackaryia.com/blog/2026-02-25/code-is-cheap-now-what/
1•Zackaryia•47m ago•1 comments

How to Thrive as a Remote Worker

https://spectrum.ieee.org/remote-work
1•jnord•48m ago•0 comments

Terra would have collapsed regardless of Jane Street

https://fragileequilibrium.substack.com/p/algorithmic-stablecoins-are-provably
2•brandoncarl•50m ago•0 comments

Could a vaccine prevent dementia? Shingles shot data only getting stronger

https://arstechnica.com/health/2026/02/could-a-vaccine-prevent-dementia-shingles-shot-data-only-g...
4•jnord•50m ago•0 comments