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 New Query Method in .NET 10

https://medium.com/c-sharp-programming/http-query-method-dotnet-10-uri-too-long-99d39df0d2d7
1•sukhpinder0804•27s ago•0 comments

Does a PhD Pay Off?

https://lemire.me/blog/2026/07/24/does-a-phd-pay-off/
1•ibobev•41s ago•0 comments

Should we become our own algorithms?

https://blog.liubuntu.tech/should-we-become-our-own-algorithms/
1•speckx•1m ago•0 comments

What Is Potential Energy, Really?

https://brianschrader.com/archive/what-is-potential-energy-really/
1•sonicrocketman•1m ago•0 comments

Show HN: Fire burn effect with Three.js and GLSL, step-by-step walkthrough

https://fablegrounds.com/labs/fire/
1•chunza2542•1m ago•0 comments

This week in AI-native companies

https://www.insideainative.com/p/this-week-in-ai-native-companies
1•mmayernick•1m ago•0 comments

Environmental groups urge EPA to reject new PFAS to cool datacenters

https://www.theguardian.com/us-news/2026/jul/27/pfas-datacenter-cooling-epa
1•random3•1m ago•0 comments

GoatCounter

https://www.ssp.sh/brain/goatcounter/
1•abnercoimbre•3m ago•0 comments

Decispher: We have added support for Grok CLI

1•iamalizaidi•3m ago•1 comments

Show HN: Reasoning-driven World Cup betting that returned 202% (121 bets)

https://github.com/chrisby/frontier-xg-world-cup
1•cbock90•4m ago•0 comments

Show HN: Infrawrench – a tool to manage cloud and svcs with workflows and chat

https://infrawrench.com
1•astrid__•4m ago•0 comments

FOSS smashed one Microsoft monopoly. It's time to smash another

https://www.theregister.com/columnists/2026/07/27/foss-smashed-one-microsoft-monopoly-after-20-ye...
2•joebuckwilliams•5m ago•0 comments

Embedding OpenAI Codex: The App Server and SDKs

https://www.akashtandon.in/interactive-explainers/codex-embedding/
1•akashtndn•8m ago•0 comments

Cassette simulator rewinds digital audio to a more analog time in hiss-tory

https://www.theregister.com/offbeat/2026/07/27/cassette-simulator-rewinds-digital-audio-to-a-more...
1•joebuckwilliams•8m ago•0 comments

So-Called "AI Communism"

https://medium.com/whither-news/ai-communism-919f8cdd76b0
1•cmrdporcupine•8m ago•1 comments

Show HN: BixRouter – a non-linear AI chat interface for OpenRouter

https://router.bix.computer
1•two-sandwich•9m ago•0 comments

Kata Containers 4.0 is less a new feature release than a platform reset to Rust

https://opensourcewatch.beehiiv.com/p/kata-containers-4-0-is-less-a-new-feature-release-than-a-pl...
1•CrankyBear•9m ago•0 comments

Wham's Surreal Trip to China

https://www.theguardian.com/film/2026/jul/27/andrew-ridgeley-wham-china-george-michael-lindsay-an...
1•tosh•10m ago•0 comments

Consolidated food supply may be worsening cyclospora outbreaks, experts say

https://www.cnbc.com/2026/07/27/cyclospora-outbreak-food-industry-consolidation.html
2•clcaev•10m ago•0 comments

Study finds shift away from cigarettes could reshape future cancer burden

https://hollingscancercenter.musc.edu/content-hub/News/2026/07/27/study-finds-shift-away-from-cig...
2•geox•11m ago•0 comments

Show HN: A lyric video as a Remotion app, written by an agent fleet

https://yupanqui.xyz/shape-of-ai
1•yupanqui•12m ago•0 comments

Show HN: Read (or listen) to a book from a single link

https://tale.fyi/a-christmas-carol
1•samuelcole•16m ago•0 comments

Lawsuit says Mayo Clinic rushed AI rollout put patient care and privacy at risk

https://www.mprnews.org/story/2026/07/09/lawsuit-alleges-mayo-clinic-cut-corners-with-ai
1•hn_acker•17m ago•1 comments

Docker alternatives for AI agents: Podman, bwrap and Firejail

https://grigio.org/docker-alternatives-for-ai-agents-podman-bwrap-and-firejail/
2•grigio•18m ago•0 comments

Ain't No Economy Like the Attention Economy: On Leaving (But Not Leaving) [video]

https://www.youtube.com/watch?v=W6L5qWmiVq0
1•devrob•20m ago•0 comments

Public Internet History (2018)

https://joereddington.com//2018/12/12/Internet.html
1•Aethelwulf•20m ago•0 comments

Rideshare and Taxi Safety: Information on Assault Data and Background Checks

https://www.gao.gov/products/gao-26-108552
3•Jimmc414•21m ago•0 comments

2x the productivity of our R&D org in 9 months

https://ideas.fin.ai/p/2x-nine-months-later
1•hliyan•21m ago•1 comments

LocaFile AI – Translate game localization files without breaking code variables

https://locafileai.com
1•phobopt•21m ago•0 comments

Hardware-Software Co-Design for Float16 On-Device Training on RISC-V Single-Core

https://arxiv.org/abs/2607.21130
1•Jimmc414•22m ago•0 comments