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: Direction – a 4-week course for people afraid of shipping AI slop

https://www.givedirection.com/
1•AndrewKemendo•48s ago•0 comments

Adobe Diddles with Your /etc./Hosts File

https://old.reddit.com/r/webdev/comments/1sb6hzk/adobe_wrote_to_my_hosts_file_ive_never_had_an_ap...
2•Brajeshwar•2m ago•1 comments

Closest Thing to Crazy

https://www.atvbt.com/closest-thing-to-crazy/
1•speckx•3m ago•0 comments

Synthetic Sandbox for Training Machine Learning Engineering Agents

https://arxiv.org/abs/2604.04872
1•gmays•3m ago•0 comments

Man jailed for killing abused wife who jumped from bridge

https://www.bbc.co.uk/news/articles/c0krdgjy0kko
1•alimw•5m ago•0 comments

Callgraph analysis in Ferrocene for denying unvalidated Rust library functions

https://ferrous-systems.com/blog/callgraph-analysis/
2•fanf2•8m ago•0 comments

MolmoWeb: An open agent for automating web tasks

https://allenai.org/blog/molmoweb
1•aanet•9m ago•1 comments

Alibaba shifts towards revenue over open-source AI

https://www.ft.com/content/b39da303-3188-447b-8b65-3dd8dad8b59a
2•marojejian•13m ago•1 comments

Waymo ride, now arriving in Nashville

https://waymo.com/blog/2026/04/your-waymo-ride-now-arriving-in-nashville/
3•ysangkok•14m ago•0 comments

Show HN: Agt00 – localhost sharing with an email allowlist

https://github.com/alex-sumin/agt00
1•cc_alex•15m ago•0 comments

The Vasa

https://psychsafety.com/the-vasa-disaster/
3•Tomte•16m ago•0 comments

Framework Next Gen Event on April 21st

https://frame.work/nextgen
1•outlore•16m ago•0 comments

Surviving Hallucinations: AI Fault Tolerance for Campaigns

https://matthodges.com/posts/2026-04-10-ai-politics-fault-tolerance/
2•m-hodges•18m ago•0 comments

What is the impact of AI on productivity?

https://aleximas.substack.com/p/what-is-the-impact-of-ai-on-productivity
2•aanet•18m ago•1 comments

Install-AI-constitution: a tool to centralise your main AGENTS.md

https://github.com/Adri96/AI-Constitution
2•adrimubo96•19m ago•1 comments

Show HN: Eve – Managed OpenClaw for Work

https://eve.new/login
3•zachdive•19m ago•0 comments

Amoxide: Composable, context-aware shell aliases

https://d34dl0ck.me/amoxide-composable-context-aware-shell-aliases/index.html
1•lukastyrychtr•20m ago•0 comments

HBO Obtains DMCA Subpoena to Unmask 'Euphoria' Spoiler Account on X

https://torrentfreak.com/hbo-obtains-dmca-subpoena-to-unmask-euphoria-spoiler-account-on-x/
3•speckx•23m ago•0 comments

Book flights MCP in a single prompt for India Flights

https://www.bookturing.com/mcp
2•avallark•23m ago•1 comments

Largest Group of Chimps Waging Deadly 'Civil War,' Scientists Discover

https://www.404media.co/worlds-largest-group-of-chimps-waging-deadly-civil-war-scientists-discover/
1•pavel_lishin•24m ago•0 comments

Dynamic Map of YouTube Channels

https://www.ytmap.xyz/
3•Bachal•25m ago•0 comments

Update on Platform Stability

https://oapen.hypotheses.org/2217
1•jruohonen•25m ago•0 comments

Okay, Color Spaces – Ericportis.com

https://ericportis.com/posts/2024/okay-color-spaces/
1•tambourine_man•26m ago•0 comments

Ask HN: Is a purely Markdown-based CRM a terrible idea? Optimized for LLM agents

1•dmonterocrespo•28m ago•0 comments

Social Media Is the Opposite of Social Life

https://www.raptitude.com/2026/04/social-media-is-the-opposite-of-social-life/
2•speckx•29m ago•0 comments

AI (and) Maximalism

https://kerkour.com/ai-maximalism
1•randomint64•31m ago•0 comments

OpenAI's Genius Plan [to Cure Cancer] Can't Possibly Fail [video]

https://www.youtube.com/watch?v=ijTxAfFUHkY
2•mentalgear•31m ago•2 comments

U.S. faces an air traffic controller shortage. It's turning to gamers for help

https://www.cbsnews.com/news/faa-video-gamers-increase-air-traffic-controllers/
1•cdrnsf•32m ago•0 comments

The Ones: Actron AM1608 16-Bit CPU. – The CPU Shack Museum

https://www.cpushack.com/2026/04/01/the-forgotten-ones-actron-am1608-16-bit-cpu/
1•rbanffy•32m ago•0 comments

Securing Vapor for the Future: Our Experience in GitHubs Secure Open Source Fund

https://blog.vapor.codes/posts/securing-vapor-for-the-future/
2•frizlab•33m ago•0 comments