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?

Ask HN: Seeking physics collaborators and compute for emergent spacetime ideas

1•kang•1m ago•0 comments

CVE-2026-98432: Linux IPv4 UAF

https://nvd.nist.gov/vuln/detail/cve-2026-98432
1•Shank•5m ago•0 comments

Claude for Clausewitz?

https://www.lowyinstitute.org/the-interpreter/claude-for-clausewitz
1•bryanrasmussen•7m ago•0 comments

Are There Problems Beyond the Reach of AI [video]

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

Show HN: I benchmarked a voice AI against real people. It scored at chance

https://mundi.chat/try
1•eromoseleinegbe•11m ago•0 comments

We're looking at a 30-year run: UK pair aim to complete most complex game

https://www.theguardian.com/lifeandstyle/2026/oct/31/uk-complete-worlds-most-complex-board-game-t...
1•oneeyedpigeon•11m ago•0 comments

Measuring voice agents: turn-taking, tool calls and expressive speech

https://soniqo.audio/blog/voice-agent-benchmarks
1•aufklarer•12m ago•0 comments

I built an Android app that translates text and turns it into MP3 audio

https://play.google.com/store/apps/details?id=com.audiocraft.app&hl=en_US
1•divyankkaushik•13m ago•0 comments

A drop in US births due to smartphone use? These researchers say so

https://www.detroitnews.com/story/tech/2026/06/13/birth-rates-decline-smartphones-iphone-study/90...
1•baxtr•19m ago•0 comments

Ask HN: Books about AI Revolution happening now

1•sleiben•20m ago•0 comments

Global fertility may have fallen below replacement level for the first time

https://qazinform.com/news/global-fertility-may-have-fallen-below-replacement-level-for-the-first...
1•baxtr•20m ago•0 comments

An AI agent read a Shift_JIS page as 208,953 replacement characters

https://github.com/openclaw/openclaw/pull/188766
1•Yigtwx•24m ago•0 comments

Real-time zero-knowledge LLM identification from physical telemetry

https://zenodo.org/records/23806637
1•IndependentRese•24m ago•0 comments

Show HN: Paste a URL, get content opportunities and an SEO brief

https://yogawritecode.com
1•writebysachin•24m ago•0 comments

Claude Ultra ($200): 20x -> 10x Pro usage every week

https://claude.com/pricing
4•tuleiff•28m ago•1 comments

Last year Americans flew to China for a $10k cancer drug. Now it's $200k

https://kdwalmsley.substack.com/p/last-year-americans-flew-to-china
1•xbmcuser•31m ago•2 comments

Nava OS 1.0 – Official Trailer – Coming 2027 [video]

https://www.youtube.com/watch?v=v2MOPr2SoD0
1•doener•33m ago•0 comments

Show HN: Inline comments for Hermes replies like Google Docs

https://github.com/rednaks/hermes-desktop-inline-comments
1•privacyonsec•35m ago•0 comments

Backbone of a beast – charting Nvidia's rise to networking titan

https://www.theregister.com/networks/2026/10/31/backbone-of-a-beast-charting-nvidias-rise-to-netw...
1•vinhnx•35m ago•0 comments

Open-weight AI models can exploit the patch gap

https://epoch.ai/publications/open-weight-models-patch-gap
1•vinhnx•36m ago•0 comments

Reading Anthropic's S-1 as a Claude Code user

https://alexkras.com/reading-anthropics-s-1-as-a-claude-code-user/
1•vinhnx•37m ago•0 comments

Commanding Heights

https://commanding-heights.com/
1•jger15•41m ago•0 comments

Show HN: Everyday Toolz – free calculators that run in the browser, no sign-up

https://everydaytoolz.com/
1•anupghimire•42m ago•0 comments

How long do you need to hold down the power button to turn off a PC?

https://www.osnews.com/story/146273/how-long-do-you-need-to-hold-down-the-power-button-to-turn-of...
4•Arodex•46m ago•0 comments

Claude Ultra Plan

https://support.claude.com/en/articles/17728952-what-is-the-ultra-plan
1•stschaef•49m ago•2 comments

Show HN: Umbra, port of an unfinished free Lovecraftian CRPG from 2001

https://github.com/dbohdan/umbra
1•networked•50m ago•0 comments

Why Google, Microsoft, Anthropic and OpenAI need their own AI detection tools

1•nitishr•53m ago•0 comments

Hop – Install Linux next to Windows without a USB stick

https://github.com/Arjun-Ingole/hop/blob/main/docs/ARCHITECTURE.md
2•philonoist•1h ago•0 comments

Show HN: KuralHub 1.0, Speech emotion datasets for 70 languages in one place

https://aaivu.github.io/KuralHub/datasets.html
2•luxshan_t•1h ago•0 comments

Show HN: Undertone – synced lyrics and beat visualizer on Linux's desktop layer

https://github.com/Mohit-Aasirwal/undertone
1•Mohit-Aasirwal•1h ago•0 comments