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•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?

Spy: language semantics for a statically-typed compiled variant of Python

https://antocuni.eu/2026/03/25/inside-spy-part-2-language-semantics/
1•fanf2•23s ago•0 comments

"Long-Term Support" doesn't mean what you think

https://pointieststick.com/2026/05/23/long-term-support-doesnt-mean-what-you-think/
1•naves•56s ago•0 comments

Layman with no degree directs AI agents to derive Newton's G to 1.86 ppm

https://github.com/oldrich-research/gravitational-constant-relation
1•Oldrich333•56s ago•0 comments

Bullwhip Effect

https://en.wikipedia.org/wiki/Bullwhip_effect
1•olalonde•1m ago•0 comments

Real Singles Near You Tonight

http://layana.meet2live.online
9•EmmaJohnsonftr•2m ago•2 comments

The Booing Will Continue Until Commencement Speeches Improve

https://gizmodo.com/the-booing-will-continue-until-commencement-speeches-improve-2000762929
1•makerdiety•3m ago•0 comments

Show HN: Lightweight, OpenSource, zero-dependency App tour & user onboarding SDK

https://www.npmjs.com/package/@qocial/tour
1•qocialApp•3m ago•0 comments

Show HN: Treasury – Ask your money anything

https://treasury.sh/
1•junead01•4m ago•0 comments

A Language for Describing Agentic LLM Contexts

https://arxiv.org/abs/2605.01920
1•mpweiher•10m ago•0 comments

Conifer, launching June first (free and open source): local inference runtime

https://conifer.build/feedback/
2•loctran0323•13m ago•0 comments

Show HN: MailMark – Cold email tool where you own your domain and mailboxes

1•debasishbarai•19m ago•0 comments

A PR proposes to stabilize the Rust allocator API

https://github.com/rust-lang/rust/pull/156882
1•afdbcreid•19m ago•0 comments

Hyper – an API framework for Bun, distributed as source

https://hyperjs.ai/
1•mmcclure•19m ago•0 comments

QuickGrab – Magic Video Downloader

https://quickgrab.app/
1•exhunter•22m ago•0 comments

TrapDoor Cross-Ecosystem Crypto Stealer Campaign

https://haltingproblems.com/analysis/trapdoor-cross-ecosystem-crypto-stealer/
1•s4mw1se•22m ago•0 comments

Show HN: Voxxy – a minimal, fast voice-to-text app for macOS

https://www.voxxy.io
9•mrguenter•25m ago•0 comments

Anita Calculators: The Technology Explained

http://www.anita-calculators.info/html/the_technology_explained.html
2•rolph•26m ago•0 comments

Flying planes in a geese formation could save carbon emissions

https://www.virgin.com/about-virgin/latest/how-flying-in-a-geese-formation-could-save-carbon-emis...
1•simonebrunozzi•29m ago•1 comments

Show HN: I built a TikTok style video debate app

https://tussup.com
1•frantzarty•29m ago•0 comments

AI agents just got their own web browser via a Firefox fork

https://blog.adafruit.com/2026/05/19/ai-agents-just-got-their-own-web-browser-via-a-firefox-fork/
2•MilnerRoute•38m ago•1 comments

Best TTS models, a blind benchmark

https://techstackups.com/articles/best-tts-2026-blind-benchmark/
1•sixhobbits•45m ago•1 comments

West Coast Cities Turn to Vacancy Taxes to Grapple with Housing Crisis

https://www.theurbanist.org/west-coast-cities-turn-to-vacancy-taxes-to-grapple-with-housing-crisis/
4•harambae•49m ago•0 comments

Rank My Salary

https://rankmysalary.com
3•zakkishahh•50m ago•0 comments

A collection of small, low stakes and low effort tools

https://delphi.tools/
1•anyonecancode•51m ago•0 comments

Ask HN: I only use 30% of my Claude max x5 all model quota

2•firemelt•51m ago•1 comments

Cheap attack drones break through Israel's Iron Dome

https://www.dw.com/en/cheap-attack-drones-break-through-israels-iron-dome/a-77235132
2•Teever•54m ago•0 comments

Machine Code For Beginners (1983) [for the Z80/6502]

https://drive.google.com/file/d/0Bxv0SsvibDMTcHNXalEtYkVtU00/view?resourcekey=0-YtCcUG7ytBL-ls8gc...
3•peter_d_sherman•54m ago•0 comments

AI poses "urgent threat" to student learning and the HSC

https://www.smh.com.au/national/nsw/ai-poses-urgent-threat-to-student-learning-and-the-hsc-202605...
2•classichasclass•55m ago•0 comments

Spoqify – Un-personalize your Spotify playlists

https://spoqify.com/
4•eiiot•1h ago•1 comments

Curing US Healthcare, Part III: The Future

https://paulkrugman.substack.com/p/curing-us-healthcare-part-iii-the
2•rbanffy•1h ago•0 comments