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?

West Memphis Three

https://en.wikipedia.org/wiki/West_Memphis_Three
1•js2•56s ago•0 comments

YouTrackDB is a general-use object-oriented graph database

https://github.com/JetBrains/youtrackdb
1•gjvc•4m ago•0 comments

Show HN:PandaClip a local mcp tool for an agents working state

https://github.com/xfloukiex-lab/pandaclip
1•VektorGeist•8m ago•0 comments

I made a neural network that I can train using my fingers

https://medium.com/@ceo_44783/i-built-a-neural-network-i-could-train-with-my-fingers-e1dd37627bf7
1•tylersuard•11m ago•1 comments

Come Friendly SBOMs

https://freebsdfoundation.org/our-work/journal/browser-based-edition/improving-software-quality/c...
1•Tomte•11m ago•0 comments

Show HN: An autonomous SOC built to refuse causation it can't prove

https://www.domesoc.com/
1•MohammadKhubaib•14m ago•0 comments

Jamkernelp2p: A sovereign P2P microkernel for ultimate lightness and control

https://github.com/jamkernel/jamkernelp2p
1•jamkernelp2p•16m ago•0 comments

Claude Science, an AI workbench for scientists

https://www.anthropic.com/news/claude-science-ai-workbench
1•mgh2•16m ago•0 comments

CTA-Pipelining: A Latency-Oriented Spatial Scaling Method for Multi-GPU Systems

https://arxiv.org/abs/2607.07862
1•matt_d•17m ago•0 comments

Rendering Fonts Quickly on the GPU

https://www.outercloud.dev/blogs/webgpu-font-rendering/
1•outercloud•17m ago•1 comments

Why South America Is So Good at Football

https://atlasdevelopment.substack.com/p/why-south-america-is-so-good-at-football
1•gmays•18m ago•0 comments

Microsoft Promises to Fix Search with Major Windows 11 Overhau

https://www.windowscentral.com/microsoft/windows-11/microsoft-announces-major-windows-11-search-o...
1•m463•20m ago•0 comments

AI Isn't Human. Stop Talking About It Like It Is

https://www.thefp.com/p/artificial-intelligence-not-human
1•arkhiver•33m ago•1 comments

Wither ACM? Publish and Perish?

https://cacm.acm.org/opinion/wither-acm-publish-and-perish/
1•jwstarr•34m ago•0 comments

A high-performance JavaScript/TypeScript compiler toolchain written in Zig

https://yuku.fyi/
1•flashblaze•35m ago•0 comments

The EU is not about to censor access to the internet

https://www.euronews.com/my-europe/2026/07/13/no-the-eu-is-not-about-to-censor-access-to-the-inte...
1•alexey-salmin•36m ago•3 comments

America's Other Elections Problem

https://www.economist.com/united-states/2026/07/13/americas-other-elections-problem
2•andsoitis•39m ago•0 comments

Informing Ourselves to Death (1990)

https://web.archive.org/web/20031029211844/http://www.frostbytes.com/~jimf/informing.html
1•Chronos52•43m ago•0 comments

Show HN: A MCP for Agents to reverse engineer binary code

https://github.com/morluto/rea
1•Mplto•43m ago•0 comments

Stop the GUARD Act and age verification laws worldwide

https://www.fsf.org/blogs/community/stop-the-guard-act
3•smitty1e•51m ago•0 comments

India halts WhatsApp global username feature over cyberfraud risk

https://restofworld.org/2026/india-whatsapp-username-ban-encryption-cyber-fraud/
1•colinprince•55m ago•0 comments

Agents.md – Dumb Human

https://gist.github.com/skorotkiewicz/2d4db4ceaf83aa54eb7f2066fdb961ff
2•modinfo•56m ago•0 comments

Our Amish Language

https://www.thedial.world/articles/news/amish-pennsylvania-dutch
3•NaOH•1h ago•0 comments

Geo‑historical platform reconstructing political entities from 3499 BCE to today

https://www.phersu-atlas.com/
1•alphabetatango•1h ago•0 comments

Electric cars are taking off quickly in Latin America

https://ourworldindata.org/data-insights/electric-cars-are-taking-off-quickly-in-latin-america
3•alphabetatango•1h ago•0 comments

The value of AI is through the programmers

https://blazordata.net/ViewBlogPost/10
1•adefwebserver•1h ago•1 comments

GPT-5.6 Sol, Terra, and Luna: A Real-World Benchmark for Developers

https://qainsights.com/gpt-5-6-sol-terra-and-luna-a-real-world-benchmark-for-developers/
1•qainsights•1h ago•0 comments

DiScoFormer: One transformer for density and score, across distributions

https://huggingface.co/blog/allenai/discoformer
1•gmays•1h ago•0 comments

Every man a VC - On public deep-tech startups

https://msolom.substack.com/p/every-man-a-vc
1•msolomentsev•1h ago•0 comments

Japan develops a method to recover up to 90% of lithium from used EV batteries

https://tech.supercarblondie.com/japan-recovers-up-to-90-of-lithium-from-used-ev-batteries/
50•donohoe•1h ago•9 comments