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?

Europe buys the future, America builds it

https://economist.com/finance-and-economics/2026/06/18/europe-buys-the-future-america-builds-it
1•andsoitis•47s ago•0 comments

Google Is Using Nvidia's Playbook to Build a Rival AI Chip Business

https://www.wsj.com/tech/ai/google-is-using-nvidias-playbook-to-build-a-rival-ai-chip-business-1e...
2•Brajeshwar•5m ago•0 comments

Show HN: SkillsGuard – static scanner for malicious AI agent skills

https://github.com/Teycir/SkillsGuard
1•teycir•5m ago•0 comments

Computer Vision – Lecture 1.1 (Introduction: Organization) [video]

https://www.youtube.com/watch?v=YW1cIaOBkI8
1•skidrow•6m ago•0 comments

Anthropic Lacks Emotional Intelligence

https://www.lawfaremedia.org/article/anthropic-lacks-emotional-intelligence
1•ano-ther•7m ago•0 comments

Get notified the second Fable 5 comes back

https://fablewatch.com
1•markksantos•7m ago•0 comments

What happens if the EU loses the AI race [video]

https://www.youtube.com/watch?v=uVPoq1Svz7g
1•SpyCoder77•11m ago•0 comments

Show HN: Konxios a local first AI OS that connects LM Studio, Ollama and cloud

https://konxios.com
1•ifrosted•16m ago•0 comments

Eerie landscape of 100.000 monoliths made with fable 5(when it was available)

https://sand-morph.up.railway.app/atlas-of-quiet-monoliths
1•echohive42•18m ago•0 comments

The science behind Qantas' bet on 20-hour flights

https://www.reuters.com/business/aerospace-defense/sleep-light-science-behind-qantas-bet-20-hour-...
1•1659447091•19m ago•0 comments

Shellular: Run agents, terminals and browser DevTools from your phone

https://shellular.dev/
3•aquajet•22m ago•0 comments

GLM-5.2 vs. Claude Opus 4.8: Full Comparison

https://llm-stats.com/blog/research/glm-5-2-vs-claude-opus-4-8
3•gjvc•26m ago•0 comments

An offline earthquake monitor that detects P-waves before S-waves

https://play.google.com/store/apps/details?id=com.muhsin.mkdepremmonitor&hl=en_US
2•Muhsinkosoglu•29m ago•0 comments

How to Get Fired Using Switch Statements and Statement Expressions (2016)

https://blog.robertelder.org/switch-statements-statement-expressions/
1•downbad_•29m ago•0 comments

Show HN: Let agents send/receive SMS using your old Android phone

https://simlink.snaz.cz/
1•LukBrezina•31m ago•0 comments

HN with Pics

https://hn.is-ai-good-yet.com/
1•ilyaizen•32m ago•1 comments

Norway Says AI Ain't for Education

https://gizmodo.com/norway-says-ai-aint-for-education-2000774320
3•01-_-•34m ago•1 comments

Ask HN: What is the cutting edge research in compilers and PLT?

1•xqb64•34m ago•0 comments

Words of Conviction

https://www.propublica.org/series/911-call-analysis-forensic-science-investigation
1•ZeljkoS•34m ago•0 comments

NASA selects Eric Schmidt's rocket company for a 2028 mission to Mars

https://www.theverge.com/science/952988/nasa-relativity-space-eric-schmidt-mars
1•01-_-•35m ago•1 comments

Life After Data: the conference on de-datafication

https://www.law.georgetown.edu/privacy-technology-center/education/life-after-data-the-conference...
1•burnto•37m ago•0 comments

Antimatter Development Program – Casey Handmer's Blog

https://caseyhandmer.wordpress.com/2025/11/26/antimatter-development-program/
1•bilsbie•37m ago•0 comments

The artificial ice pyramids saving India's mountain villages

https://www.bbc.com/news/articles/c072414183go
1•Brajeshwar•39m ago•0 comments

Delete Doesn't Mean Deleted. Just Ask OpenAI

https://lindsaygross1.substack.com/p/delete-doesnt-mean-deleted-just-ask
4•rmason•43m ago•0 comments

Agentic Capital Raising What?

https://octum.ai/glossary/agentic-capital-research.html
1•stevejobs1287•43m ago•0 comments

Drudge Report for Institutional Allocators

https://www.sovguild.org/intelligence/
1•stevejobs1287•44m ago•0 comments

A free book on operating AI coding tools (no signup, source on GitHub)

https://dive.vladyslavpodoliako.com/
2•Belkins•46m ago•1 comments

EWD361: Programming as a discipline of mathematical nature [video]

https://www.youtube.com/watch?v=awYLxNV3zmA
1•akiarie•48m ago•0 comments

Testing Azure free tier with a live Juneteenth trivia competition

https://web.triviablack.com/board/juneteenth2026
3•hercules08•52m ago•0 comments

Daily AI briefing narrated by Seinfeld

https://nanloss.com/briefings/2026-06-18
2•rajap•52m ago•0 comments