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?

How drones could be used to track plastic litter on Irish beaches

https://www.rte.ie/brainstorm/2026/0424/1569594-ireland-beaches-plastic-pollution-litter-drone-fo...
1•austinallegro•4m ago•0 comments

Show HN: Daily China AI news briefing – engineering, product, and business

https://overnightai.substack.com/p/china-ai-news-eight-chinese-chip
1•jackyli02•5m ago•0 comments

Ask HN: I built an AI planner that adapts routines automatically – feedback?

1•Profazia•10m ago•0 comments

FDA gives the green light to the first gene therapy for deafness

https://www.npr.org/2026/04/23/nx-s1-5795526/deafness-gene-therapy-regeneron
1•geox•11m ago•0 comments

Wisp – Social that's fun again

https://wisp.mobile
2•janandonly•11m ago•0 comments

Wikipedia's AI Policy

https://en.wikipedia.org/wiki/Wikipedia:Artificial_intelligence
4•Antibabelic•15m ago•0 comments

Kremlin's tightening grip on internet fuels Russian discontent

https://www.bbc.com/news/articles/cr510de17jlo
1•breve•16m ago•0 comments

Mathesar 0.10.0

https://docs.mathesar.org/0.10.0/releases/0.10.0/
1•klaussilveira•17m ago•0 comments

Mounting tar archives as a filesystem in WebAssembly

https://jeroen.github.io/notes/webassembly-tar/
3•datajeroen•17m ago•0 comments

Impactmel Is Available

https://impactmel.com
1•pndize•18m ago•0 comments

Hidden Secrets in the ArXiv: Information Disclosure in Preprint Source Files

https://arxiv.org/abs/2604.20927
1•bageldesert•19m ago•0 comments

Ask HN: What sw do you dream about but don't have the time to code yourself?

1•curtisblaine•22m ago•1 comments

Artificial intelligence is creeping into American lawmaking

https://www.economist.com/united-states/2026/04/23/artificial-intelligence-is-creeping-into-ameri...
1•edward•22m ago•0 comments

Ask HN: Am I getting old, or is working with AI juniors becoming a nightmare?

3•MichaelRazum•23m ago•2 comments

Ask HN: Who is using DeepSeek in production

2•h99•23m ago•0 comments

DeepSeek-V4: Making 1M token context efficient

https://firethering.com/deepseek-v4-open-source-million-token-context/
2•steveharing1•23m ago•0 comments

OpenAI has the governance structure of a unicorn – it does not exist

https://readuncut.com/open-ai-has-little-effective-governance/
1•dnsb•26m ago•0 comments

Half a Month of Consolation Writing Advice

https://www.astralcodexten.com/p/half-a-month-of-consolation-writing
1•herbertl•28m ago•0 comments

How to Make Sense of AI

https://commoncog.com/how-to-make-sense-of-ai/
2•dnnddidiej•30m ago•0 comments

Seed3D 2.0

https://seed.bytedance.com/en/seed3d_2_0
1•pella•31m ago•0 comments

Why software fundamentals matter more than ever [video]

https://www.youtube.com/watch?v=v4F1gFy-hqg
1•zingar•33m ago•0 comments

The global edtech boom is fading as investors look elsewhere

https://restofworld.org/2026/edtech-funding-collapse-k12-startups-ai-workforce/
1•thm•33m ago•0 comments

Removal of Microplastics from Drinking Water by Moringa Oleifera Seed

https://pubs.acs.org/doi/10.1021/acsomega.5c11569
2•fodmap•34m ago•0 comments

AI Agent Designs a RISC-V CPU Core from Scratch

https://spectrum.ieee.org/ai-chip-design
2•pseudolus•37m ago•0 comments

Facts versus Understanding

https://www.solipsys.co.uk/ZimExpt/FactsVersusUnderstanding.html?zd24hn
2•ColinWright•38m ago•1 comments

US accuses China of "industrial-scale" AI theft. China says it's "slander"

https://arstechnica.com/tech-policy/2026/04/us-accuses-china-of-industrial-scale-ai-theft-china-s...
7•jnord•40m ago•0 comments

Electrostatics and High Voltage Links

http://amasci.com/static/electrostatic1.html
1•ludicrousdispla•43m ago•0 comments

Cohere and Aleph Alpha Merger

https://www.nytimes.com/2026/04/24/business/cohere-aleph-alpha-ai-merger.html
3•warthog•43m ago•0 comments

Spectro – macOS app to detect fake lossless audio files

https://www.getspectro.app
3•ddtcx•48m ago•0 comments

How Much Information Does Adding Noise Remove?

https://www.testingbranch.com/information_loss_and_noise/
2•mpcsb•58m ago•0 comments