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?

We Are Excited About Confessions

https://alignment.openai.com/confessions/
1•TMWNN•1m ago•0 comments

Mira Murati's startup, is losing two of its co-founders to OpenAI

https://techcrunch.com/2026/01/14/mira-muratis-startup-thinking-machines-lab-is-losing-two-of-its...
1•7777777phil•4m ago•0 comments

How the Washington State Legislature Works

https://www.brethorsting.com/blog/2026/01/how-the-washington-state-legislature-works/
1•aaronbrethorst•5m ago•0 comments

Tenor API is shutting down

2•ankushkun_•5m ago•1 comments

What If Your AI Never Forgot? The Claude 4 Memory Experiment

https://www.gptfrontier.com/what-if-your-ai-never-forgot-the-claude-4-memory-experiment/
1•ssengupta3•6m ago•0 comments

Dynamic semantic navigation for app launchers

1•powerwordtree•6m ago•0 comments

You Are Claude Code, Anthropic's Official CLI for Claude

https://fst.wtf/you-are-claude-code-anthropics-official-cli-for-claude
1•fullstacktard•7m ago•0 comments

When a Free Model Beat Claude-Sonnet-4.5

https://askcodi.substack.com/p/when-a-free-model-beat-claude-sonnet
1•himalayansailor•10m ago•0 comments

NCSA: The unsung hero of Internet history

https://dfarq.homeip.net/ncsa-the-unsung-hero-of-internet-history/
1•jnord•10m ago•0 comments

The White House just said your life is worth nothing. Yes, literally.

https://electrek.co/2026/01/13/the-white-house-just-said-your-life-is-worth-nothing-yes-literally/
2•FabHK•13m ago•0 comments

End of AI Amnesia? Understand the Tech Behind Google's "Titans" Permanent Mind

https://www.gptfrontier.com/the-end-of-ai-amnesia-why-googles-titans-are-the-blueprint-for-a-perm...
2•ssengupta3•15m ago•1 comments

Recursive Language Models: RAG now obsolete

https://twitter.com/rryssf_/status/2010699140431503692
2•MrBuddyCasino•16m ago•0 comments

Cryptolog – The NSA's Internal Magazine

https://view.officeapps.live.com/op/view.aspx?src=https%3A%2F%2Fnsarchive%2Egwu%2Eedu%3A443%2Fsit...
2•polalavik•16m ago•0 comments

eBPF Party: Interactive eBPF Playground

https://ebpf.party/
3•signa11•17m ago•0 comments

A$AP Rocky Releases Helicopter Music Video Featuring Gaussian Splatting

https://radiancefields.com/a-ap-rocky-releases-helicopter-music-video-featuring-gaussian-splatting
3•ChrisArchitect•19m ago•0 comments

Meta Lays Off 1,500 People in Metaverse Division

https://www.wsj.com/tech/meta-layoffs-reality-labs-2026-347008b0
4•1vuio0pswjnm7•20m ago•1 comments

Teach your child how to think

https://tanin.nanakorn.com/teach-your-child-how-to-think/
2•tanin•20m ago•0 comments

Google Gemini Can Proactively Analyze Users' Gmail, Photos, Searches

https://www.bloomberg.com/news/articles/2026-01-14/google-gemini-s-personalized-intelligence-feat...
2•1vuio0pswjnm7•21m ago•1 comments

Microsoft vows to 'pay its way' as it seeks to defuse data centre backlash

https://www.ft.com/content/3f392c9b-c07d-42f5-b000-0a7347ad1ec0
2•1vuio0pswjnm7•24m ago•0 comments

Mobile-first IDE demo for coding without a computer

https://clem1212.github.io/ide/
2•BobbyBrowntwin•27m ago•0 comments

Show HN: Free, maintenance‑free semantic search and related posts for Hexo

https://github.com/SemanticSearch-ai/hexo-plugin
2•oldcai•30m ago•0 comments

Texas Police Invested Millions in a Shadowy Phone-Tracking Software

https://www.texasobserver.org/texas-police-invest-tangles-sheriff-surveillance/
3•helsinkiandrew•33m ago•0 comments

Minecraft Damage Calculator

https://calcforge.net/tools/minecraft-damage-calculator/
2•bitvvip•35m ago•0 comments

Show HN: Skild – The NPM for AI agent skills

https://skild.sh
2•peiiii•35m ago•0 comments

NASA astronauts begin 'bittersweet' medical evacuation from space station

https://www.bbc.co.uk/news/articles/c205r8n0276o
2•lifeisstillgood•35m ago•0 comments

ChatGPT Translate

https://chatgpt.com/translate
2•chenzhekl•36m ago•2 comments

Two Thinking Machines Lab Cofounders Are Leaving to Rejoin OpenAI

https://www.wired.com/story/thinking-machines-lab-cofounders-leave-for-openai/
1•cpeterso•37m ago•0 comments

Just Get a Better Job

https://idiallo.com/blog/just-get-another-job
4•jnord•38m ago•1 comments

Relativity of Generative Aesthetics

https://jimiwen.substack.com/p/relativity-of-generative-aesthetics
1•jimiwen•38m ago•0 comments

US gov't: House sysadmin stole 200 phones, caught by House IT desk

https://arstechnica.com/tech-policy/2026/01/us-govt-house-sysadmin-stole-200-phones-caught-by-hou...
3•jnord•40m ago•1 comments