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

24-year-old ditched her smartphone and social media known as 'appstinent'

https://www.cnbc.com/2026/03/10/a-24-year-old-who-ditched-her-smartphone-and-social-media-wants-y...
2•1vuio0pswjnm7•1m ago•0 comments

AI Aadhaar OCR API for Fast Aadhaar Data Extraction

1•azapi_ai•6m ago•0 comments

Meta to charge advertisers a fee to offset Europe's digital taxes

https://www.reuters.com/business/media-telecom/meta-charge-advertisers-fee-offset-europes-digital...
1•1vuio0pswjnm7•7m ago•0 comments

We built NPM for agent knowledge – Context Packs on Armalo (update)

https://www.armalo.ai/
1•ArmaloAI•11m ago•1 comments

David Woo: The Market Is Wrong About Iran, Oil and What Comes Next [video]

https://www.youtube.com/watch?v=W2Z6UVv_wl4
1•thomassmith65•13m ago•1 comments

Why Ads in Chatbots May Not Click

https://www.wsj.com/tech/ai/why-ads-in-chatbots-may-not-click-2ca52203
1•1vuio0pswjnm7•13m ago•0 comments

Neuromorphic sphere topology Hebbian learning as a path to grounded intelligence

1•rusanovych•13m ago•0 comments

Intent-Driven Development

https://jason-stillwell.com/blog/2026/03/10/intent-driven-development/
2•dragonfax•16m ago•3 comments

Long/short extensions diversify concentrated stock tax-neutrally (2025)

https://www.blackrock.com/us/financial-professionals/insights/diversify-with-long-short
1•vismit2000•19m ago•0 comments

Made my first Chrome extension: Gmail Feed (from a non-technical background)

https://chromewebstore.google.com/detail/gmail-feed/npahlccednamnmabhaiifdmioibcmilg
2•adarshkaraka•21m ago•1 comments

Claude Code Added /Btw

https://twitter.com/trq212/status/2031506296697131352
1•gslin•24m ago•0 comments

Mnemos – scoped local memory for coding agents (public beta)

https://mnemos.making-minds.ai
1•anthony-maio•25m ago•1 comments

A2A Accountability Protocol for MCP – intent/acceptance/execution receipts

https://trustagentai.net
1•kirillostrovsky•25m ago•1 comments

Are You Comfortable Putting Your Name on This? (AI-Assisted Development)

https://vibe2value.com/are-you-comfortable-putting-your-name-on-this/
1•mattcameron•27m ago•1 comments

We Built a 100K-Line Enterprise App Using AI – Here's Why Vibe-Coding Couldn't

https://medium.com/towards-artificial-intelligence/we-built-a-100k-line-enterprise-app-using-ai-h...
1•anil789•27m ago•1 comments

Hugging Face Storage Buckets

https://huggingface.co/storage
1•nnx•27m ago•0 comments

Are you letting agents run infra tools / scripts yet?

2•shashahchk•29m ago•3 comments

Making WebAssembly a first-class language on the Web

https://hacks.mozilla.org/2026/02/making-webassembly-a-first-class-language-on-the-web/
2•mikece•33m ago•0 comments

Separating AI agent reasoning from execution, crypto binding execution

1•ketanbj•34m ago•0 comments

Standardizing Source Maps

https://bloomberg.github.io/js-blog/post/standardizing-source-maps/
2•Timothee•35m ago•0 comments

Microsoft backs Anthropic to halt US DoD's 'supply-chain risk' designation

https://www.reuters.com/legal/litigation/microsoft-files-amicus-brief-support-anthropics-lawsuit-...
2•drewda•36m ago•0 comments

CVE-2026-3288: K8s ingress-nginx path injection via rewrite-target annotation

https://nvd.nist.gov/vuln/detail/CVE-2026-3288
1•zdkaster•39m ago•1 comments

Ask HN: Devs who are out of work – what are you doing for income now?

3•a1n•41m ago•0 comments

Trump says U.S. will build first refinery in 50 years

https://www.cnbc.com/2026/03/11/trump-us-oil-refinery-reliance-ambani-texas-india-shale-wti.html
3•kamaraju•50m ago•0 comments

A Mysterious Signal Transfixes Radio Sleuths and Intelligence Experts

https://www.rferl.org/a/mystery-numbers-station-persian-signal-iran-war/33700659.html
3•willvk•59m ago•0 comments

Switch: Benchmarking the Handling of TCIs in Long-Horizon Embodied Scenarios

https://huggingface.co/papers/2511.17649
1•tellarin•1h ago•0 comments

I built a free narrative game inspired by Daniel Kokotajlo's AI 2027 essay

https://ai2028.ai/
1•geniusxp•1h ago•1 comments

Improving instruction hierarchy in frontier LLMs

https://openai.com/index/instruction-hierarchy-challenge
1•surprisetalk•1h ago•0 comments

Microsoft uses plagiarized AI slop flowchart to explain how GitHub works

https://www.pcgamer.com/software/ai/microsoft-uses-plagiarized-ai-slop-flowchart-to-explain-how-g...
5•gpvos•1h ago•1 comments

Maybe we can keep on coding? pseudo code project

4•EmptyDrum•1h ago•3 comments