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?

PauseHer – hold a yoga pose to unlock Instagram or TikTok

https://apps.apple.com/us/app/pauseher-yoga-before-scroll/id6759345933
1•vector_pro•1m ago•0 comments

Truth, Power, and Honest Journalism

https://radleybalko.substack.com/p/truth-power-and-honest-journalism
1•justin66•2m ago•0 comments

Spreadsheet Errors: Manual Data Mistakes Are Costing Thousands

https://www.doss.com/no-script
1•nhatcher•3m ago•0 comments

Trump poised to drop IRS suit, launch $1.7B 'weaponization' fund for allies

https://abcnews.com/US/trump-poised-drop-irs-suit-launch-17b-weaponization/story?id=132962661
1•justin66•3m ago•0 comments

Omnisearch – A lightweight metasearch engine written in C

https://git.bwaaa.monster/omnisearch/about/
1•bitbasher•3m ago•0 comments

AI Did Not

https://www.stephenlewis.me/blog/ai-did-not/
1•monooso•4m ago•0 comments

'I didn't want to be the guinea pig': inside tech's AI-fueled manager purge

https://www.theguardian.com/technology/2026/may/15/ai-manager-purge-tech
1•n1b0m•6m ago•0 comments

Browser Run: now running on Cloudflare Containers, it's faster and more scalable

https://blog.cloudflare.com/browser-run-containers/
1•danborn26•7m ago•0 comments

The old world of tech is dying and the new cannot be born

https://www.baldurbjarnason.com/2026/the-old-world-of-tech-is-dying/
3•speckx•10m ago•0 comments

DeepSeek V4 Pro and Flash vs. Claude Opus 4.7 and Kimi K2.6

https://blog.kilo.ai/p/we-tested-deepseek-v4-pro-and-flash
1•heymax054•12m ago•1 comments

Show HN: Bit-exact Elixir port of UltraLogLog (Ertl, VLDB 2024)

https://github.com/thatsme/ultra_log_log
1•alessio66•17m ago•0 comments

Empty Waymos invade Atlanta neighborhood, circle culdesac for hours

https://www.wsbtv.com/news/local/atlanta/empty-waymos-invade-atlanta-neighborhood-circle-cul-de-s...
1•Cuzzo•18m ago•0 comments

Health coverage is getting killed by Google AI Overviews

https://pressgazette.co.uk/media-audience-and-business-data/ai-overviews-publisher-traffic/
1•thm•18m ago•0 comments

Big Data Expo North America 2026

https://simplai.ai/blogs/simplai-ai-big-data-expo-north-america-2026/
1•emilypellegrini•19m ago•0 comments

Why AI tools make some teams slower

https://articles.zimetic.com/why-ai-tools-make-some-teams-slower/
1•bzimbelman•19m ago•0 comments

Beware what you tell your AI chatbot. It's not a shrink – it's a snitch

https://www.theguardian.com/commentisfree/2026/may/13/beware-what-you-tell-your-ai-chatbot-its-no...
2•Michelangelo11•20m ago•1 comments

Ask HN: High-level hardware description language?

2•nyeah•20m ago•0 comments

DRY and Solid Are More Important Than Ever in the Age of AI

https://tolgee.io/blog/dry-and-solid-are-more-important-than-ever-in-the-age-of-ai
2•jancizmar•23m ago•0 comments

Energy supplier abandons Lake Tahoe residents to serve data centers

https://arstechnica.com/ai/2026/05/energy-supplier-abandons-lake-tahoe-residents-to-serve-data-ce...
1•freetime2•24m ago•0 comments

Power Tools Got Worse on Purpose. Who Owns DeWalt, Craftsman, and Milwaukee?

https://www.worseonpurpose.com/p/your-power-tools-got-worse-on-purpose
2•prawn•25m ago•0 comments

Bitwarden scrubs 'Always free' and 'Inclusion' values from its site

https://www.fastcompany.com/91542655/bitwarden-scrubs-always-free-and-inclusion-values-from-its-w...
5•gpi•28m ago•0 comments

Radicle: Sovereign {code forge} built on Git

https://radicle.dev/
11•KolmogorovComp•32m ago•0 comments

Meta to Start Capturing Employee Mouse Movements, Keystrokes for AI Training

https://daringfireball.net/linked/2026/05/10/meta-employee-spyware
3•tosh•34m ago•0 comments

1: Heidegger's Parmenides, Alain Badiou

https://direct.mit.edu/books/edited-volume/2292/chapter-abstract/59949/Heidegger-s-Parmenides?red...
2•rballpug•35m ago•1 comments

About Technical Debates (2010)

https://weblogs.asp.net/scottgu/about-technical-debates-both-in-general-and-regarding-asp-net-web...
1•TowerTall•35m ago•1 comments

El Niño is likely to emerge soon and continue through winter 2026-27

https://www.cpc.ncep.noaa.gov/products/analysis_monitoring/enso_advisory/ensodisc.shtml
2•geox•36m ago•0 comments

The Checklist: All the checklist you'll ever need (WIP)

https://www.thechecklist.app/
1•hirawat•36m ago•0 comments

How does Flathub even work? The CDN and caching layer

https://barthalion.blog/flathub-internals-cdn/
1•JNRowe•37m ago•2 comments

Lending Money to Friends. What's at Stake Beyond the Amount

https://comuniq.xyz/post?t=1083
1•01-_-•39m ago•0 comments

Why the Monty Hall Problem Drives People Crazy

https://www.oranlooney.com/post/monty-hall/
2•olooney•39m ago•0 comments