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?

Oura postpones it's IPO with 24hrs notice citing AI threat

https://www.businessinsider.com/oura-smart-ring-postpones-ipo-cites-market-uncertainty-2026-9
1•etienne_ad•4m ago•1 comments

Bru – SMS from the browser. Send and recieve files. Share clipboard text

https://bru.works/
1•sverrejb•8m ago•1 comments

Event Sourcing and Actor model in Ruby [video]

https://www.youtube.com/watch?v=Q6owchf4WEo
1•GenericCanadian•9m ago•0 comments

Stop Guessing Why Your AI Fails: Meet Tanvelo

1•Tanvelo•11m ago•0 comments

EU accused of hiding environmental impact of data centers

https://www.politico.eu/article/eu-complaint-data-center-energy-water-lighthouse-reports/
2•tbirch•14m ago•1 comments

Show HN: AFAW – A multi-agent coding workflow that doesn't trust the model

https://github.com/agustindiazcano/afaw-anti-fragile-agentic-workflow
1•agusdiazcano•17m ago•0 comments

Composites for Stage 2

https://docs.google.com/presentation/d/1lN-LdmUQ9Nh6bF-5uuuuAQhHtDBTmI9xfYyj6TH_8F4/edit?slide=id...
1•tosh•17m ago•0 comments

Chinese spies used lies, love and betrayal to target the Federal Reserve

https://www.cnbc.com/2026/09/30/john-rogers-fed-china-espionage-case.html
2•cramer4next•20m ago•0 comments

"Apple engineer" builds GitHub AI torture chamber to inflict "pain" on models

https://www.machine.news/apple-engineer-builds-github-ai-torture-chamber-to-inflict-digital-pain-...
1•LargeLingoMod•20m ago•0 comments

Israel-bound flight diverted to Saudi Arabia after brawl between pilots

https://www.reuters.com/world/middle-east/diverted-flydubai-flight-israel-was-not-hijacking-incid...
4•skibz•21m ago•1 comments

Notes on Working with Coding Agents

https://adri0.com/blog/notes-on-working-with-coding-agents
1•quite-sfwd•22m ago•1 comments

Getting Banned by ChatGPT, Thrice

2•nirav_rohra•23m ago•0 comments

Religious Scholars Met with Anthropic. What They Heard Stunned Them

https://www.nytimes.com/2026/09/29/us/anthropic-claude-morals-ai.html
2•pseudolus•24m ago•1 comments

Superalignment (Situational Awareness)

https://situational-awareness.ai/superalignment/
2•ronfriedhaber•24m ago•0 comments

OpenSSL High DTLS flaw can leak heap memory (CVE-2026-84782)

https://openssl-library.org/news/secadv/20260929.txt
1•joshcsimmons•25m ago•0 comments

Vanguard warns France is 'degrading credit' as borrowing costs surge

https://www.ft.com/content/7820a84f-338e-4b91-a9b6-241a9bf81539
2•rzk•25m ago•0 comments

Show HN: Scrieb – Offline meeting transcription, diarization and summaries

https://scrieb.com/
1•alxkzh•30m ago•0 comments

What's the Future for Pure Math Research in the Age of AI?

https://writings.stephenwolfram.com/2026/09/whats-the-future-for-pure-math-research-in-the-age-of...
2•demivoleegaston•30m ago•0 comments

Twin

https://twin.siddharththakkar.xyz/
1•woustachemax•32m ago•0 comments

OpenAI Dev Day, Dot and OpenAI's Product Transition, Sign in with ChatGPT

https://stratechery.com/2026/openai-dev-day-dot-and-openais-product-transition-sign-in-with-chatgpt/
1•swolpers•37m ago•0 comments

Who's Responsible for Irresponsible AI?

https://www.deeplearning.ai/the-batch/whos-responsible-for-irresponsible-ai
2•svg7•37m ago•0 comments

Declaration of the Rights of Man and of the Citizen

https://en.wikipedia.org/wiki/Declaration_of_the_Rights_of_Man_and_of_the_Citizen
1•peter_d_sherman•38m ago•0 comments

Brief exposure to hopeful YouTube videos reduces depressive symptoms

https://psycnet.apa.org/doiLanding?doi=10.1037%2Fppm0000676
2•geox•41m ago•0 comments

Gold Kubb Fanless MiniPC, with 13kg of gold (worth $1.7M)

https://www.fanlesstech.com/2026/09/gold-kubb-fanless.html
1•giuliomagnifico•42m ago•0 comments

Programmatic Tool Calling

https://developers.openai.com/api/docs/guides/tools-programmatic-tool-calling
1•tosh•43m ago•0 comments

Experimental Distinguishability of Computed and Fundamental Physical Dynamics

https://omarali.me/papers/computed-vs-fundamental-physical-dynamics
1•omarali-me•44m ago•0 comments

Show HN: VoxScribe – local, offline voice dictation for Windows (open source)

https://github.com/ahmedhmam1994/voxscribe-ai-voice-dictation
2•ahmedibrahim199•44m ago•0 comments

Useful JavaScript Features Added in ECMAScript 2026

https://jsdev.space/ecmascript-2026-features/
1•javatuts•44m ago•0 comments

How to Sync a Design System with Claude Design

https://nitayneeman.com/blog/how-to-sync-a-design-system-with-claude-design/
1•nitayneeman•45m ago•0 comments

AeroJAX

https://github.com/arriemeijer-creator/AeroJAX
1•marklit•45m ago•0 comments