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

Amazon laying off about 16,000 corporate workers in latest anti-bureaucracy push

https://www.cnbc.com/2026/01/28/amazon-layoffs-anti-bureaucracy-ai.html
1•bluedino•28s ago•0 comments

AI Kind of Sucks at Retouching, Study Says

https://www.thephoblographer.com/2026/01/27/ai-vs-human-retouching-the-quality-gap-is-bigger-than...
1•iamA_Austin•2m ago•0 comments

Claude Code Tips for Large Projects

https://ziva.sh/blogs/claude-code-tips-large-projects
1•OsrsNeedsf2P•2m ago•0 comments

Show HN: Camera Benchmark Tool – Fast, Clean Side-by-Side Camera Comparisons

https://xthe.com/camera-benchmark-tool/
1•xthe•2m ago•0 comments

Show HN: SHDL – A Minimal Hardware Description Language Built from Logic Gates

https://github.com/rafa-rrayes/SHDL
1•rafa_rrayes•3m ago•0 comments

Wire Messenger Is Down

https://status.wire.com/
1•rixrax•4m ago•0 comments

Particle is being acquired by Digi to power the next 40 years of IoT innovation

https://www.particle.io/blog/particle-is-being-acquired-by-digi-to-power-the-next-40-years-of-iot...
1•adunk•4m ago•0 comments

Introducing: React Best Practices

https://vercel.com/blog/introducing-react-best-practices
2•aierastack•5m ago•0 comments

Building a JavaScript runtime in one month

https://themackabu.dev/blog/js-in-one-month
1•begoon•5m ago•0 comments

The SQL Query Roadtrip: The Indexes

https://internals-for-interns.com/posts/postgres-indexes/
1•weinzierl•5m ago•0 comments

Turn your phone into a productivity tool

https://www.laurieherault.com/articles/turn-your-phone-into-a-productivity-tool
1•laurieherault•5m ago•1 comments

SoftBank in Talks to Invest Up to $30B More in OpenAI

https://www.wsj.com/tech/ai/softbank-in-talks-to-invest-up-to-30-billion-more-in-openai-8585dea3
1•JumpCrisscross•5m ago•0 comments

New Apple AirTag Teardown

https://bsky.app/profile/stacksmashing.bsky.social/post/3mdi6jbojr224
1•hasheddan•7m ago•0 comments

Conjuring portals with real-time video and Gaussian Splats

https://app.daydream.live/creators/yondonfu/conjuring-portals-with-real-time-video-and-gaussian-s...
1•chaghalibaghali•9m ago•0 comments

Meta-Corning $6B fiber deal signals a new bottleneck in AI infrastructure

https://www.networkworld.com/article/4123460/meta-corning-fiber-deal-signals-a-new-bottleneck-in-...
1•giuliomagnifico•9m ago•0 comments

Amazon to Lay Off Around 16,000 Corporate Employees

https://www.wsj.com/tech/amazon-to-lay-off-around-16-000-corporate-employees-932df0be
4•JumpCrisscross•10m ago•0 comments

"Corporate power" doesn't mean anything

https://www.slowboring.com/p/corporate-power-doesnt-mean-anything
1•amadeuspagel•15m ago•0 comments

443M-year-old fossils reveal early vertebrate eyes

https://www.manchester.ac.uk/about/news/443-million-year-old-fossils-reveal-early-vertebrate-eyes/
1•gnufx•18m ago•0 comments

3D Visualization of an GPT-Style LLM

https://github.com/bbycroft/llm-viz
1•onurkanbkrc•18m ago•0 comments

RQ Money: open-source personal finace software made in Lazarus

https://www.rqmoney.eu/index.html
1•userSumo•20m ago•0 comments

GM is quietly becoming a subscriptions company

https://www.businessinsider.com/general-motors-gm-earnings-subscriptions-revenue-business-2026-1
1•cebert•22m ago•0 comments

A Timeline of Interesting Takes on Agentic AI Use in Software Engineering

https://www.appsoftware.com/blog/a-timeline-of-interesting-takes-on-agentic-ai-capability-in-soft...
1•appsoftware•27m ago•0 comments

Week 3: The Trojan Horse – OpenChaos Blog

https://blog.openchaos.dev/posts/week-3-the-trojan-horse
1•Daviey•28m ago•0 comments

When Zero‑Width Isn't Zero

https://www.thedroidsonroids.com/blog/when-zero-width-isnt-zero
1•submiter_dor•30m ago•1 comments

Show HN: Dripemails.org - completely free drip email campaigns, from a YC alumni

https://dripemails.org/
1•alexS•31m ago•0 comments

Sweden weighs Franco-British nuclear weapons cooperation

https://breakingdefense.com/2026/01/sweden-eyes-franco-british-nuclear-weapons-cooperation/
5•saubeidl•32m ago•0 comments

What whale timing reveals across tokens and NFTs

https://kettaro.com/
1•chainbuilder•33m ago•1 comments

Andara Game

https://andara-game.netlify.app/
1•stvkoch•33m ago•2 comments

Show HN: VNOL – The Vendor-Neutral Cognitive OS Layer for Agent Portability

1•grrajan•35m ago•0 comments

Vanishing Act: Barbara Follett, transfixed the literary world-then vanished

https://www.laphamsquarterly.org/celebrity/vanishing-act
1•Popeyes•36m ago•0 comments