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?

Questions to Custom Business Funding

https://fundingexplained.com/business-funding-quiz/
1•FE_com•1m ago•0 comments

Telstra outage blamed on known bug in obsolete server

https://ia.acs.org.au/article/2026/telstra-outage-blamed-on-known-bug-in-obsolete-server.html
2•shakna•7m ago•0 comments

We don't let the LLM decide what's clinically allowed

https://www.hamo.ai/blog/taking-the-clinical-decision-out-of-the-llm/
1•chrischengzh•8m ago•0 comments

Trust but Verify? Uncovering the Security Debt of Autonomous Coding Agents

https://arxiv.org/abs/2607.12428
1•Timofeibu•10m ago•0 comments

Xtree Fan Page

https://www.xtreefanpage.org/
1•razodactyl•10m ago•0 comments

Google and Epic stop fighting – third-party Android app stores coming next week

https://www.theverge.com/policy/965792/google-epic-withdraw-injunction-third-party-app-stores-com...
1•OuterVale•14m ago•0 comments

Show HN: I open-sourced the portal I built for a client's vibe-coded apps

https://github.com/menagerai/menagerai
1•tipani•16m ago•1 comments

Threading the AI in the UI for a personal app

https://millfolio.app/blog/millwright-ui-layers/
1•winding•18m ago•0 comments

Colombian Public School Reaches Top in Best School Prizes 2026

https://colombiaone.com/2026/07/13/colombian-public-school-reaches-top-10-in-worlds-best-school-p...
1•thunderbong•20m ago•0 comments

Poland begins construction of €2.3B deepwater port on Baltic coast

https://notesfrompoland.com/2026/07/14/poland-begins-construction-of-e2-3bn-deepwater-port-on-bal...
1•cromka•20m ago•0 comments

Is this the end of the once-mighty GoPro?

https://amateurphotographer.com/latest/photo-news/going-going-gone-is-this-the-end-of-the-once-mi...
1•aanet•25m ago•1 comments

Using One Agent Across Multiple Machines

https://syncless.ai/articles/let-syncless-across-your-environments
1•mountainview•26m ago•0 comments

The Matter of Taste(2018)

https://www.callum.website/the-matter-of-taste
1•num42•34m ago•0 comments

AgentCall – turn any coding agent into a live meeting participant

https://agentcall.dev
3•Marium_zehra•35m ago•0 comments

From Sawdust to Paw Patrol: The Spin Master Story (With Ronnen Harary) [audio]

https://www.econtalk.org/from-sawdust-to-paw-patrol-the-spin-master-story-with-ronnen-harary/
1•mooreds•35m ago•0 comments

Stripe, Advent offer to buy PayPal for more than $53B

https://www.reuters.com/business/finance/stripe-advent-offer-buy-paypal-more-than-53-billion-sour...
8•rvz•38m ago•3 comments

Atto Primo Oh God Opera Song

https://open.spotify.com/album/7DTggs1Cj2YcOmuJUWjjM4
1•mjbachhav•38m ago•0 comments

Show HN: GWZ – Git Workspace Zone (multi-repo that feels like plain Git)

2•owebeeone•42m ago•0 comments

The great flattening – article on Vorflux (launched by Rippling co-founder)

https://twitter.com/myprasanna/status/2077065557204222238
1•vardhanw•43m ago•1 comments

Sunburn Calculator

https://sunburntimer.com/
2•ckcheng•44m ago•0 comments

Make any winning ad yours

https://trykopykat.com/
1•justinbuilds•44m ago•1 comments

Our Company Was Worth $6B. We Shared Passwords over Slack

https://www.cerby.com/blog/our-company-was-worth-6-billion.-we-shared-passwords-over-slack
1•mooreds•45m ago•0 comments

Mr. Putin, where is the gas?

https://kyivindependent.com/mr-putin-where-is-the-gas/
1•dotcoma•51m ago•0 comments

Cell Just Changed Biology

https://www.youtube.com/watch?v=g9B3gBhcwqM
1•soupspaces•52m ago•0 comments

Data Showing Palantir's Positive Impact on NHS Riddled with Errors

https://novaramedia.com/2026/07/13/data-showing-palantirs-positive-impact-on-nhs-riddled-with-err...
4•notRobot•53m ago•1 comments

Mako: A Self-Evolving Agentic Operating System for Autonomous Web Exploitation

https://arxiv.org/abs/2607.11288
1•praneethn•53m ago•0 comments

Google Images is getting a visual refresh as it turns 25

https://www.neowin.net/news/google-images-is-getting-a-visual-refresh-as-it-turns-25/
1•bundie•56m ago•1 comments

CoreWeave considers derivatives to hedge against falling memory prices

https://finance.yahoo.com/markets/options/articles/exclusive-ai-cloud-company-coreweave-235016062...
1•mapping365•57m ago•0 comments

Flap Display//SF Ferries

https://www.chloeyan.me/ferry
1•audreyfei•1h ago•0 comments

I thought I had a good homelab

https://humanparadox.org/i-thought-i-had-a-good-homelab/
1•colingauvin•1h ago•0 comments