frontpage.
newsnewestaskshowjobs

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?

Developer APIs for parsing and tailoring CVS

1•engspeedy•5m ago•0 comments

Bubble Sort Game

https://patrickgh3.itch.io/bubble-sort
1•memalign•7m ago•0 comments

Show HN: Tracking iCal feed latency across O365/Google/Apple

https://sync.timetastic.co.uk/
1•turkeywelder•8m ago•0 comments

Sorry, my software is better with agents

https://macro.land/blog/sorry-my-software-is-better-with-agents/
1•priyadarshy•11m ago•0 comments

Plotnine

https://plotnine.org/
1•tosh•12m ago•0 comments

Hey, N00B, We Didn't Hire You to Complete Tasks

https://newsletter.kentbeck.com/p/hey-n00b-we-didnt-hire-you-to-complete
1•RebootStr•14m ago•0 comments

Show HN: The Deconstructed VS Code

https://github.com/dipankar/dscode
1•dipankarsarkar•18m ago•0 comments

A coin toss isn't random. Maybe our choices aren't either

https://gt.ms/blog/free-will/?v=2
2•geetuu•18m ago•0 comments

PageToMD – A CLI tool to turn web pages into clean Markdown for AI agents

https://github.com/gs202/PageToMD
1•gs202•18m ago•0 comments

Vibe Coding at Scale? Engineering Strikes Back

https://blog.owulveryck.info/2026/06/19/vibe-coding-at-scale-engineering-strikes-back.html
1•owulveryck•19m ago•0 comments

Switching AI Tools Mid-Sprint Cost Us a Day (and What We Learned) – Week 6 R

https://theaileverageweekly.com/posts/how-switching-ai-tools-mid-sprint-cost-us-a-day-and-what-we...
1•talvardi7•19m ago•0 comments

Gistpreview.github.io: Gist HTML Preview

https://github.com/gistpreview/gistpreview.github.io
1•gurjeet•19m ago•0 comments

LUKS suspend failed to wipe volume encryption key from memory since Linux 6.9

https://mathstodon.xyz/@iblech/116769502749142438
1•microtonal•23m ago•0 comments

Why local AI – and why it matters

https://nexusfoundation.ngo/why-local-ai
1•kris_osiadacz•32m ago•0 comments

Braess's Paradox

https://en.wikipedia.org/wiki/Braess%27s_paradox
1•the-mitr•32m ago•0 comments

Bobby Prince's Doom (1993) Soundtrack Inducted into Library of Congress

https://playday.one/2026/05/14/bobby-princes-doom-soundtrack-inducted-into-library-of-congress/
2•nomilk•33m ago•0 comments

Phoebus Cartel

https://en.wikipedia.org/wiki/Phoebus_cartel
1•thunderbong•34m ago•0 comments

Build your own vulnerability harness

https://blog.cloudflare.com/build-your-own-vulnerability-harness/
2•Gipsyfine•35m ago•0 comments

Finding the Link Uber Missed: How to Connect AI Code Spend to Business Value

https://medium.com/@navigara/you-cant-measure-roi-on-ai-coding-tools-if-you-never-measured-engine...
1•alienll•38m ago•0 comments

Show HN: NetSentinel – a local network security scanner and connectivity monitor

https://github.com/ossianericson/netsentinel
2•ossianericson•38m ago•0 comments

BookMarkr – Local first visually organized bookmark Chrome extension

https://chromewebstore.google.com/detail/bookmarkr-—-visual-bookma/lianafemkbankodapdaokiefoffi...
1•mnomansd•39m ago•0 comments

Unreal deprecrates Blueprints, their visual programming language in UE6.1

https://xcancel.com/unrealengine/status/2067661808903577646
1•Signez•39m ago•0 comments

Lakehouse//RT: Real-Time Performance on a Unified Lakehouse

https://www.databricks.com/blog/introducing-lakehousert-real-time-performance-unified-lakehouse
1•throwaw12•39m ago•0 comments

How to Drive an LLM

https://home.robusta.dev/blog/how-to-drive-an-llm
1•nyellin•40m ago•0 comments

What 'Getting Your Hands Dirty' Means at LLM-Era

https://carette.xyz/posts/the_mud_and_the_mind/
5•maarcel93•46m ago•1 comments

The new HTTP QUERY method explained

https://kreya.app/blog/new-http-query-method-explained/
3•CommonGuy•47m ago•0 comments

Gemini provides phone number of scammer posing as Delta Airlines

https://old.reddit.com/r/artificial/comments/1u9t7mp/gemini_helped_me_get_scammed/
1•LeoPanthera•48m ago•0 comments

Ask HN: What do you use for scientific presentations?

3•hamburgererror•54m ago•1 comments

Show HN: UAVs FYI – Drone database with supply chain data, API and CLI

https://www.uavs.fyi/
1•Osoraku•55m ago•0 comments

GLM-5.2: Chop off 84% of the volume from a 1.5TB model, still retain 82% power

https://twitter.com/AYi_AInotes/status/2067642004184383564
4•vantareed•55m ago•1 comments