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•9mo 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•9mo 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•9mo 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•9mo 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•9mo ago
Load test against a clone instead of a DB whose contents you care about?

Tesla's Self-Driving Has Gotten Amazing

https://pogueman.substack.com/p/dammit-teslas-self-driving-has-gotten
1•andsoitis•6m ago•0 comments

Google offers buyouts to staff in its business unit who aren't 'all in'

https://www.businessinsider.com/google-offers-exit-packages-to-some-business-unit-employees-2026-2
1•samaysharma•8m ago•0 comments

Indian teacher who created hundreds of learning centers wins $1M Global Prize

https://apnews.com/article/global-teacher-prize-rouble-nagi-54a0fbd628ab062aba569457ff01d21d
1•thunderbong•10m ago•0 comments

ModernBERT in Jax/Flax

https://github.com/arnavw/modernbert-flax
1•alien0006•13m ago•0 comments

My team lead wants 25% of the total bonus pool for himself

https://old.reddit.com/r/founder/comments/1r2lj1g/my_team_lead_wants_25_of_the_total_bonus_pool_for/
1•fanux•14m ago•0 comments

AI Assisted Linguistic Synth:Mapping Proto-Sinaitic Roots in Voynich Manuscript

https://github.com/adrihd/voyters
1•adrihd•15m ago•1 comments

Inside the Secret Smear Machine That's Targeting Hollywood

https://www.hollywoodreporter.com/business/business-news/inside-hollywood-smear-campaign-scandals...
1•mikhael•15m ago•0 comments

Software Is User Action

https://software-action.hyperclay.com/
2•YounesDz•24m ago•0 comments

Separation of Concerns: You're Cutting Along the Wrong Line

https://inferal.com/blog/separation-of-concerns/
1•donutshop•30m ago•0 comments

The Farm That 600M IP Addresses Called Home

https://www.connected.app/library/the-farm-that-600-million-ip-addresses-called-home-1u5uogt
2•kirkouimet•31m ago•0 comments

Bay Area tech CEO given $3.5M severance payment as company lays off hundreds

https://www.sfgate.com/tech/article/workday-severance-layoffs-21346064.php
5•starkparker•31m ago•2 comments

Terence Tao: Machine Assistance and the Future of Research Mathematics [video]

https://www.youtube.com/watch?v=SuTxpKggY30
1•20repsquat•37m ago•1 comments

Show HN: Motivé – AI-generated cover letters tailored to job descriptions

https://motive8.ca
1•joelkapuku•39m ago•0 comments

The Royal Game of Ur [video]

https://www.youtube.com/watch?v=WZskjLq040I
1•theGeatZhopa•40m ago•0 comments

Show HN: Self-updating engineering blogs repo with GitHub Actions

https://github.com/mayankchauhan971/engineering-blogs
2•break_prod•45m ago•0 comments

Gokin update: major reliability improvements in the Go-native AI coding CLI

https://github.com/ginkida/gokin
1•ginkida•48m ago•0 comments

1.3M Epstein documents index on Postgres

https://old.reddit.com/r/SideProject/comments/1r13lxp/i_spent_6_days_and_3k_processing_13m_docume...
3•jerdman76•48m ago•0 comments

Show HN: Crank – The SSH Terminal Manager for Engineers Who Refuse to Close Tabs

https://github.com/nexivibe/crank
4•mathgladiator•52m ago•0 comments

Warcraft III Peon Voice Notifications for Claude Code

https://github.com/tonyyont/peon-ping
3•doppp•52m ago•0 comments

Show HN:ProductFront-Streamlined product discovery platform for maximum exposure

https://www.productfront.tech
1•kdev28•53m ago•0 comments

D Programming Language

https://dlang.org/
7•arcadia_leak•53m ago•2 comments

Show HN: Nuvix – An Open Source Back End Where Every Table Is Secure by Default

https://github.com/Nuvix-Tech/nuvix
1•ravikantsaini•54m ago•0 comments

How to Use Google Trends and SEO Tools to Brainstorm Blog Topics

https://kitful.ai/blog/how-to-use-google-trends-and-seo-tools-to-brainstorm-blog-topics
1•eashish93•56m ago•0 comments

Show HN: SpearTrades – Crypto risk, health and portfolio analytics

https://speartrades.com
1•sumitarya•1h ago•0 comments

Programming Aphorisms

https://matklad.github.io/2026/02/11/programming-aphorisms.html
2•signa11•1h ago•0 comments

The "Are You Sure?" Problem: Why Your AI Keeps Changing Its Mind

https://www.randalolson.com/2026/02/07/the-are-you-sure-problem-why-your-ai-keeps-changing-its-mind/
1•EvgeniyZh•1h ago•0 comments

Show HN: Cross-platform audio notifications for Claude Code

https://github.com/ChanMeng666/claude-code-audio-hooks
1•chanmeng666•1h ago•0 comments

Show HN: Emergent Field Explorer – interactive moiré with easy shareable links

https://mcbgl.vercel.app/?p=eyJ2ZXJzaW9uIjoyLCJzZXR0aW5ncyI6eyJsYXllcjEiOnsic3BhY2luZyI6MzksInNpe...
1•mcdowell_atx•1h ago•0 comments

My wife calls me, panicked

https://twitter.com/ModernDad/status/2021675945581486309
9•latchkey•1h ago•3 comments

Ask HN: How do you deal with long Covid?

4•manx•1h ago•2 comments