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?

Molecular switch converts cancer cells to normal cells

https://ecancer.org/en/news/25982-discovery-of-molecular-switch-that-reverses-cancerous-transform...
1•jbrins1•34s ago•0 comments

React-State-Basis: Runtime Architectural Auditor for React

https://github.com/liovic/react-state-basis
1•taubek•57s ago•0 comments

Google deprecates Gemini-2.5-pro

https://ai.google.dev/gemini-api/docs/deprecations
1•manx•1m ago•0 comments

Rule 110

https://en.wikipedia.org/wiki/Rule_110
1•freakynit•3m ago•0 comments

GB Renewables Map

https://renewables-map.robinhawkes.com/#5/55/-3.2
1•kitd•5m ago•0 comments

Norwegian Police live charts to rais awareness about abusive material

https://police2peer.politiet.no/
2•KGunnerud•10m ago•0 comments

Visual Studio Code: January 2026 (version 1.109)

https://code.visualstudio.com/updates/v1_109
1•tosh•11m ago•0 comments

Resist and Unsubscribe

https://www.resistandunsubscribe.com
2•rpgbr•12m ago•0 comments

How we made geo joins 400× faster with H3 indexes

https://floedb.ai/blog/how-we-made-geo-joins-400-faster-with-h3-indexes
6•matheusalmeida•15m ago•0 comments

Show HN:I made CyberChecker after finding exposed Stripe keys in production

https://www.cyber-checker.com/
1•aiseoscan•18m ago•0 comments

Send push notifications without an app

https://pushary.com
1•aadilghani•18m ago•1 comments

Dash Cam Front and Rear

https://bestdashcamfrontandrear.net/
1•wangmao•19m ago•0 comments

Show HN: Track International Rugby with Live Rankings and Predictions

https://www.rugbyrankings.now/
1•lukejkwarren•26m ago•0 comments

Show HN: Remote AI coding without moving your code – CloudForge

https://cloud-forge.me
1•KenzoArai•27m ago•0 comments

UK unemployment set to hit 11-year high in 2026, NIESR forecasts

https://www.reuters.com/business/world-at-work/uk-unemployment-set-hit-11-year-high-2026-niesr-fo...
3•hmmmmmmmmmmmmmm•30m ago•1 comments

Show HN: I built an AI UGC video generator for ads and creators

https://aiugcvideogen.com/
2•wsmhj•33m ago•0 comments

Nishiōizumimachi

https://en.wikipedia.org/wiki/Nishi%C5%8Dizumimachi
2•praash•35m ago•0 comments

Show HN: Open-source dbt package for B2B SaaS GTM/PLG metrics and AI context

https://github.com/ArvoanDev/growthcues-core
1•arvoantoni•36m ago•1 comments

Show HN: ReFrame – Linux remote desktop that supports Login on Wayland/TTY

https://github.com/AlynxZhou/reframe
2•AlynxZhou•37m ago•0 comments

I Read the Anthropic Legal Prompts That Crashed $285B in Stocks

https://thomas-witt.com/blog/285-billion-wiped-out-because-of-a-text-file/
2•thomas_witt•37m ago•2 comments

Ask HN: Hire academic researchers and train them up to be good SWEs?

1•tdsone3•40m ago•1 comments

Show HN: OneMinuteBranding – From prompt to brand system and Claude.md in 60s

https://www.oneminutebranding.com
1•YannBuilds•45m ago•3 comments

The Missing Layer

https://yagmin.com/blog/the-missing-layer/
9•lubujackson•48m ago•1 comments

In Defence of GnuPG: Key Sovereignty in an Age of Digital Feudalism [video]

https://fosdem.org/2026/schedule/event/WHHWGT-in-defence-of-gnupg/
1•m3rcury•48m ago•0 comments

A developers' job is to reduce ambiguity

https://old.reddit.com/r/ExperiencedDevs/comments/1qq8y8u/comment/o2f1f0b/
1•abrbhat•56m ago•0 comments

Why Replacing Developers with AI Is Going Horribly Wrong? [video]

https://www.youtube.com/watch?v=WfjGZCuxl-U
1•wg0•56m ago•0 comments

Sazabi Manifesto

https://www.sazabi.com/manifesto
1•puppion•57m ago•0 comments

I've created a tool to make your Discord server indexable on Google and AI

2•jackota•59m ago•3 comments

DAiFi Whitepaper Released: A New Era of Decentralized AI Finance

https://www.daifi.ai/blog/daifi-whitepaper-released
1•whatsupdog•1h ago•1 comments

Show HN: LocalCoder – Tell it your hardware, get the exact local AI model to run

https://localcoder.xyz
1•JoseOSAF•1h ago•0 comments