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?

This paper has been cited more than 6k times. It's fatally flawed.

https://statmodeling.stat.columbia.edu/2026/01/22/aking/
1•timr•3m ago•0 comments

Goose-friendly MCP server for conducting I Ching divinations

https://github.com/threemachines/i-ching
1•barrenko•4m ago•0 comments

World Models

https://ankitmaloo.com/world-models/
1•ankit219•4m ago•0 comments

Latest ChatGPT model uses Elon Musk's Grokipedia as source, tests reveal

https://www.theguardian.com/technology/2026/jan/24/latest-chatgpt-model-uses-elon-musks-grokipedi...
2•guilamu•6m ago•0 comments

The Podcaster Poking at France's Biggest Secrets

https://www.nytimes.com/2026/01/25/world/europe/philippe-collin-france-podcast-history-world-war-...
1•mikhael•9m ago•0 comments

German economists push for gold repatriation from U.S. vaults

https://seekingalpha.com/news/4542254-german-economists-push-for-gold-repatriation-from-us-vaults
1•saubeidl•10m ago•0 comments

Rack – A local data stack operated with Claude Code

https://github.com/tylerdiaz/rack
1•tylerdiaz•11m ago•0 comments

Clawdbot Showed Me What the Future of Personal AI Assistants Looks Like

https://www.macstories.net/stories/clawdbot-showed-me-what-the-future-of-personal-ai-assistants-l...
2•thoughtpeddler•15m ago•0 comments

The coming war on Car Ownership

https://geohot.github.io//blog/jekyll/update/2026/01/25/war-on-car-ownership.html
2•tea_drinker•17m ago•0 comments

Show HN: HouseTrak – everything about your home in one app

https://housetrak.app
1•tas-blacktorch•17m ago•0 comments

Bandcamp becomes the first major music platform to ban AI content

https://www.theverge.com/news/861794/bandcamp-ban-ai-music
1•01-_-•19m ago•0 comments

Microsoft gave customers' BitLocker encryption keys to the FBI

https://www.tomshardware.com/tech-industry/cyber-security/microsoft-gave-customers-bitlocker-encr...
1•01-_-•19m ago•0 comments

I built a 2x faster lexer, then discovered I/O was the real bottleneck

https://modulovalue.com/blog/syscall-overhead-tar-gz-io-performance/
2•p4bl0•20m ago•0 comments

Show HN: MonsterWriter – An Overleaf Alternative with a Better Free Plan [video]

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

Qwen3-TTS: Ultra-Low Latency (97ms), Voice Cloning and OpenAI-Compatible API

https://github.com/QwenLM/Qwen3-TTS
1•thunderbong•21m ago•0 comments

Conditional Privilege Escalation Synology DSM 7.3.2

https://thecontractor.io/synology-dsm-7-3-2/
2•splintersio•26m ago•0 comments

Sodebo Ultim 3 Smashes Jules Verne Trophy Record

https://www.sail-world.com/news/293210/Sodebo-Ultim-3-smashes-Jules-Verne-Trophy-Record
1•tonfa•27m ago•0 comments

Pity the Rich

https://www.gojiberries.io/pity-the-rich/
1•neehao•30m ago•0 comments

Glowing Polyhedrons – LED filament 3D objects using graph theory

https://cpldcpu.github.io/2026/01/24/glowing-polyhedrons/
1•cpldcpu•33m ago•0 comments

Hexapod Simulator

https://hexapod-simulator.onrender.com/
1•ustad•36m ago•0 comments

Shot Heard Round the World America Rock [video]

https://www.youtube.com/watch?v=Y6ikO6LMxF4
1•rolph•39m ago•0 comments

You'll Be Back – Hamilton Animatic [video]

https://www.youtube.com/watch?v=-P_1RYVTjcA
1•rolph•41m ago•0 comments

I hate forms and I must data entry

https://skeda.app/blog/i-hate-forms-and-yet-i-must-data-entry
1•Dansvidania•43m ago•0 comments

Sony Data Discman

https://huguesjohnson.com/random/sony-ebook/
1•naves•44m ago•0 comments

Deutsche Telekom is violating Net Neutrality

https://netzbremse.de/en/
3•tietjens•45m ago•0 comments

"Destination Space" (1959 movie)

https://archive.org/details/destination-space-1959-colorized
2•Animats•46m ago•1 comments

Riemann Mapping Theorem

https://en.wikipedia.org/wiki/Riemann_mapping_theorem
2•ogogmad•47m ago•1 comments

Anchor Interpolated Morph (Aim)

https://nerdy.dev/anchor-interpolated-morphing
1•SouravInsights•49m ago•0 comments

Why Developing for MS SharePoint Is a Horrible, Terrible, and Painful Experience

https://jordansrowles.medium.com/why-developing-for-microsoft-sharepoint-is-a-horrible-terrible-a...
1•thibautg•58m ago•0 comments

Like digging 'your own grave': The translators grappling with losing work to AI

https://www.cnn.com/2026/01/23/tech/translation-language-jobs-ai-automation-intl
19•myk-e•59m ago•3 comments