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

Proof of the Riemann Hypothesis (?)

https://www.youtube.com/watch?v=jKJDZuVh8Ys
1•vital•1m ago•0 comments

You Have Only X Years to Escape Permanent Moon Ownership

https://www.astralcodexten.com/p/you-have-only-x-years-to-escape-permanent
1•rbanffy•1m ago•0 comments

Explosively pumped flux compression generator

https://en.wikipedia.org/wiki/Explosively_pumped_flux_compression_generator
1•nickt•1m ago•0 comments

The Alma Array Is Completed with 145 New Low-Noise Amplifiers

https://www.universetoday.com/articles/the-alma-array-is-completed-with-145-new-low-noise-amplifiers
1•rbanffy•2m ago•0 comments

Chrome plugin to automatically convert x.com links to xcancel.com

https://codeberg.org/nice222/Xoff
1•doener•3m ago•1 comments

Cultured meat protein has higher bioactive peptides than traditional proteins

https://www.sciencedirect.com/science/article/abs/pii/S0308814625049118
1•Luc•3m ago•0 comments

ICE plans $100M 'wartime recruitment' push targeting gun shows

https://www.washingtonpost.com/technology/2025/12/31/ice-wartime-recruitment-push/
1•doener•5m ago•0 comments

Show HN: Rstful – Agentic RSS Reader

https://www.rstful.com/
1•autodidacc•5m ago•0 comments

Run your own local TradingView and AI quant research lab in 5 minutes

https://github.com/brokermr810/QuantDinger
1•quantdinger•6m ago•1 comments

FYI: These Are the Asteroids You Should Mine

https://gizmodo.com/fyi-these-are-the-asteroids-you-should-mine-2000704248
1•rbanffy•7m ago•0 comments

Two concurrency patterns which avoid goroutine leaks

https://nsrip.com/posts/goroutineleak.html
1•enz•7m ago•0 comments

Microsoft CEO Satya Nadella wants you to stop calling AI "slop" in 2026

https://www.windowscentral.com/microsoft/microsoft-ceo-satya-nadella-really-wants-you-to-stop-cal...
2•randycupertino•7m ago•0 comments

Show HN: mcpc – a universal CLI client for MCP, with tool calling and code mode

https://twitter.com/jancurn/status/2007144080959291756
1•jancurn•10m ago•0 comments

Cuba's New Chapter in Agroecology

https://www.slowfood.com/blog-and-news/cubas-new-chapter-in-agroecology/
1•ciconia•10m ago•0 comments

The large language model series developed by Qwen

https://github.com/QwenLM/Qwen3
1•gangtao•11m ago•0 comments

Ask HN: Freelancer? Seeking freelancer? (January 2026)

2•jon_north•12m ago•1 comments

IPCrypt: A common approach to IP Address encryption

https://ipcrypt-std.github.io/
1•owl_vision•12m ago•0 comments

Zero State Coherence and Emotional Intelligence: Convergence Equals Truth

2•buttersmoothAI•13m ago•0 comments

When the interpreter wept: What automation erases inside Europe's institutions

https://www.politico.eu/article/when-the-interpreter-wept-what-automation-erases-inside-europes-i...
2•patricko123•13m ago•1 comments

What does a doctor look like? Asking AI

https://www.bmj.com/content/391/bmj-2025-088968
1•speckx•15m ago•0 comments

Rodney Brooks' Technology Predictions Scorecard

https://rodneybrooks.com/predictions-scorecard-2026-january-01/
1•asafira•15m ago•0 comments

Welcome to the Office. Now Take Off Your Shoes

https://www.nytimes.com/2026/01/02/business/welcome-to-the-office-now-take-off-your-shoes.html
1•pavel_lishin•16m ago•0 comments

Telling the story of Ultima across 2 years and 20 hours+ of documentaries

https://www.pcgamer.com/games/rpg/a-good-idea-infinite-drive-and-lots-of-diet-pepsi-how-youtube-e...
1•CharlesW•17m ago•0 comments

The Emerging AI Society

https://craftyduck.rocks/blog/the-plan
3•goferito•18m ago•1 comments

Show HN: Social platform for sharing wishes validated by community coin tosses

https://coinfountains.com/
1•julienreszka•19m ago•0 comments

In 2025, AI Became My Co-Founder

https://pmfmachine.substack.com/p/in-2025-ai-became-my-co-founder
1•richardblythman•19m ago•0 comments

Show HN: When Agents Write Your Code, Who's Responsible for Security?

https://handsom.ai/blog/when-agents-write-your-code-who-is-responsible-for-security
1•justinThompson•19m ago•0 comments

Skill for 2026: Critical Ignoring

https://www.wsj.com/tech/personal-tech/critical-ignoring-social-media-7e236f52
2•julienchastang•25m ago•0 comments

Acoustic Side Channel Attack on Keyboards (2023)

https://arxiv.org/abs/2308.01074
3•perceptronas•26m ago•0 comments

Change is the root of all evil bugs

https://fhur.me/posts/2026/change-is-the-root-of-all-evil-bugs
1•TheAnkurTyagi•26m ago•0 comments