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?

The Trump Administration Is Publishing a Stream of Nazi Propaganda

https://www.theatlantic.com/national-security/2026/01/social-media-trump-administration-dhs/685659/
1•zerosizedweasle•34s ago•0 comments

Bitcoin 2-Month Low as Gold and Stocks Give Up Gains, Crypto Liquidations $800M

https://decrypt.co/356330/bitcoin-2-month-low-gold-stocks-give-up-gains-crypto-liquidations-800m
1•paulpauper•1m ago•0 comments

PicoIDE An open source IDE/ATAPI drive emulator for vintage computers

https://www.crowdsupply.com/polpotronics/picoide
1•helfire•2m ago•0 comments

Man impersonating FBI agent tried to get Luigi Mangione out of jail

https://apnews.com/article/luigi-mangione-jail-release-arrest-brooklyn-dc5ec1c87b636bfe99352ef329...
1•bradleyankrom•2m ago•0 comments

Sly Dunbar, Whose Drumming Brought Complex Beats to Reggae, Dies at 73

https://www.nytimes.com/2026/01/28/arts/music/sly-dunbar-dead.html
1•paulpauper•4m ago•0 comments

Is school worse for your kids than social media?

https://marginalrevolution.com/marginalrevolution/2026/01/is-school-worse-for-your-kids-than-soci...
1•paulpauper•4m ago•0 comments

YouTube wiped 4.7B+ views worth of AI brainrot

https://www.androidpolice.com/youtube-is-indeed-getting-rid-of-ai-slop/
1•SunshineTheCat•5m ago•0 comments

Is this dumb? A "mother may I" hook for Claude Code

https://github.com/dts/mother
1•Dstaudigel•6m ago•1 comments

Encrypted Peer-to-Peer Messaging via Decentralized Bluetooth Mesh

https://github.com/permissionlesstech/bitchat/blob/main/WHITEPAPER.md
1•us321•7m ago•0 comments

WriteFreely: An open source platform for building a writing space on the web

https://writefreely.org/
1•doener•8m ago•0 comments

Building Less Painful AI Code Production Lines

https://www.mitchschwartz.co/2026/01/designing-less-painful-ai-production.html
1•MitchSchwartz•8m ago•0 comments

The Hidden Costs of Additions to a System

https://leomax.fyi/blog/the-hidden-costs-of-additions-to-a-system/
1•mvestri•9m ago•0 comments

Procial – social instance for more advanced (pro) users, who enjoy Mastodon but

https://procial.tchncs.de/
1•doener•9m ago•0 comments

Explore some of the finest open-source software out there

https://tchncs.de/en/
1•doener•13m ago•0 comments

The Duelling Rhetoric at the AI Frontier

https://deadneurons.substack.com/p/the-duelling-rhetoric-at-the-ai-frontier
1•gmays•14m ago•0 comments

The Arc of the Practical Creator

https://home.moretothat.com/p/the-arc-of-the-practical-creator
1•herbertl•16m ago•0 comments

Cos goes FOSS The sorry state of scientific publishing and how we could

https://jekelylab.github.io/COS_goes_FOSS_publishing.html#/title-slide
1•nabla9•17m ago•0 comments

Rate Limiter with Caddy and Fail2ban

https://blog.schallbert.de/en/fail2ban-with-caddy/
1•indigodaddy•19m ago•0 comments

Parca Continuous Profiling

https://github.com/parca-dev/parca
2•shablulman•22m ago•0 comments

Datadog started collecting EXPLAIN ANALYZE plans for Postgres queries

https://www.datadoghq.com/blog/database-monitoring-explain-analyze/
1•dujuku•23m ago•1 comments

Q&A: Intermittent fasting's link to gut bacteria could combat obesity

https://medicalxpress.com/news/2026-01-qa-intermittent-fasting-link-gut.html
2•PaulHoule•23m ago•0 comments

Show HN: Yanna Cursor, but for documents (draft → edit → redline → e-sign)

https://app.yanna.pro/review-and-sign
2•adamazak•23m ago•0 comments

Building Docs Like a Product

https://emschwartz.me/building-docs-like-a-product/
1•emschwartz•23m ago•0 comments

Show HN: eMitt – Inbound email processing server with LLM-powered automation

https://github.com/schappim/emitt
1•schappim•25m ago•0 comments

If you're using AI for coding, bookmark cursor.directory

https://cursor.directory/
1•websku•32m ago•0 comments

Retiring GPT-4o, GPT-4.1, GPT-4.1 mini, and OpenAI o4-mini in ChatGPT

https://openai.com/index/retiring-gpt-4o-and-older-models/
27•rd•32m ago•21 comments

Show HN: ARC-AGI-3 Toolkit

https://docs.arcprize.org
3•gkamradt•33m ago•1 comments

Preferencing in Algorithmic Hiring: Empirical Evidence and Insights

https://papers.ssrn.com/sol3/papers.cfm?abstract_id=5417394
2•surprisetalk•35m ago•0 comments

Simulate Sun Shadows

https://shademap.app
2•surprisetalk•35m ago•0 comments

A College Alternative

https://quarter--mile.com/A-College-Alternative
1•surprisetalk•35m ago•0 comments