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

The U.S. spent $30B to ditch textbooks

https://fortune.com/2026/02/21/laptops-tablets-schools-gen-z-less-cognitively-capable-parents-fir...
1•_tk_•1m ago•1 comments

The Ocean Is Too Loud. Can You Turn It Down Please?

https://afterasana.substack.com/p/the-ocean-is-too-loud-can-you-turn
1•sam-cop-vimes•5m ago•0 comments

Social media firms head to court over harms to children's mental health

https://apnews.com/article/social-media-trials-meta-zuckerberg-youtube-tiktok-addiction-85c4d813c...
1•mpweiher•6m ago•0 comments

The Dillo Appreciation Post

https://bobbyhiltz.com/posts/2026/02/dillo-appreciation/
1•birdculture•8m ago•0 comments

The One Billion Row Challenge – A Fun Exploration

https://github.com/graphicsMan/1brc
1•rbanffy•10m ago•0 comments

Show HN: The Bridge Language – Declarative dataflow for controlled egress

https://github.com/stackables/bridge
1•aarnelaur•11m ago•0 comments

Show HN: The Birds in My Backyard

https://alec.is/birds/
1•arm32•11m ago•0 comments

Show HN: Screenwright – Turn Playwright E2E tests into polished demo videos

https://github.com/guidupuy/screenwright
2•duwip•13m ago•0 comments

Software is getting slower more rapidly than hardware is becoming faster

https://en.wikipedia.org/wiki/Wirth%27s_law
1•tosh•14m ago•0 comments

Show HN: Tickr – AI project manager that lives inside Slack (replaces Jira)

1•tickr•14m ago•0 comments

Access to a Shared Unix Computer

http://tilde.club/
1•TigerUniversity•15m ago•0 comments

Ask HN: How do new blogs break the backlink–indexing loop?

1•lilcodingthings•18m ago•0 comments

Show HN: Modern Reimplementation of the Speck Molecule Renderer

https://github.com/vangelov/modern-speck
1•vlad_angelov•19m ago•0 comments

Tesla admits it still needs drivers and remote operators

https://electrek.co/2026/02/19/tesla-admits-needs-drivers-and-remote-operators-argues-better-than...
1•xnx•26m ago•0 comments

Show HN: Django-xbench – slow endpoint aggregation for Django

https://github.com/yeongbin05/django-xbench
1•yeongbin05•26m ago•1 comments

Show HN: I built a free tool to find recent news about any company

https://champsignal.com/tools/company-news-finder
1•maximedupre•29m ago•1 comments

Front end Developer, slap yourself if you cannot explain 10 of the following

https://twitter.com/SumitM_X/status/2025051353790493028
2•ksec•31m ago•0 comments

Show HN: Horizon – My AI-powered personal news aggregator and summarizer

https://github.com/Thysrael/Horizon
1•gg_equal_G•38m ago•0 comments

Show HN: Zog parsing JSONL at 3 GB/s by not parsing it

https://github.com/aikoschurmann/zog
1•aikoschurmann•38m ago•0 comments

It is time for Europe to weaponise its chokepoints

https://www.ft.com/content/b92fd917-9f1b-4393-b96d-6d22ba757c72
1•ironyman•40m ago•1 comments

Show HN: Screenix, a Screen Studio Alternative for Ubuntu

https://screenix.studio
1•femtobusa•41m ago•0 comments

Show HN: Brevoir The due diligence infrastructure that angel investing never had

https://brevoir.com
1•nabuhad•41m ago•0 comments

AI Slopageddon and the OSS Maintainers

https://redmonk.com/kholterhoff/2026/02/03/ai-slopageddon-and-the-oss-maintainers/
1•jruohonen•43m ago•1 comments

A solar-powered website, which means it sometimes goes offline (2021) [pdf]

https://computingwithinlimits.org/2021/papers/limits21-abbing.pdf
1•tosh•43m ago•0 comments

Google keyword `brew` points to a malicious site with false instructions

https://github.com/Homebrew/install/issues/1074
2•latexr•44m ago•0 comments

Restricting code touch to engineers turns AI into a bottleneck amplifier

https://www.aldovincenti.com/blog/restricting-code-touch-ai-bottleneck-amplifier/
3•aldovincenti•50m ago•0 comments

Levelsio: HN is more negative lately because of AI threat

https://twitter.com/levelsio/status/2025430673285071295
2•Varqu•51m ago•0 comments

Can anyone help with GitHub project for a calendar?

https://johndlafayette.github.io/CalendarForKimble/
1•quantum2022•54m ago•1 comments

Show HN: Monitor your team's Cursor AI spend before the invoice hits

1•ofershap•58m ago•0 comments

New Sabre-Crested Spinosaurus Species

https://www.nhm.ac.uk/discover/news/2026/february/new-sabre-crested-spinosaurus-species-named-fro...
2•within_will•59m ago•0 comments