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?

Skorpion OS – AI-Powered Linux Distribution

https://skossyte.pages.dev/english
1•indigodaddy•2m ago•0 comments

Show HN: Aether Summon – A New TCG

https://gamefound.com/en/projects/aether-summon/aether-summon
1•hnedeotes•2m ago•0 comments

2968 OSS RL EVs by CI

1•alternateman•3m ago•0 comments

Tx.taxi: I forked mempool.space, but for (soon-to-be) every blockchain

https://tx.taxi/
1•slithering•4m ago•1 comments

From Holy Water to Frozen Meals: The Evolution of Vending Machines

https://www.saturdayeveningpost.com/2026/09/from-holy-water-to-frozen-meals-the-evolution-of-vend...
1•ohjeez•5m ago•0 comments

Are Weighted Blankets Beneficial?

https://economist.com/science-and-technology/2026/09/25/are-weighted-blankets-really-beneficial
1•andsoitis•5m ago•0 comments

What did AI researchers think at the end of 2024?

https://www.lesswrong.com/posts/62j5mPY8pFo2GD5fo/what-did-ai-researchers-think-at-the-end-of-2024-1
1•joozio•5m ago•0 comments

Show HN: Spivak's Calculus formalized in Lean 4 – every theorem, every problem

https://github.com/stormj-UH/spivak-lean
1•jsLavaGoat•6m ago•0 comments

Aulico: Free TradingView Alternative

https://www.aulico.com
1•rendernos•7m ago•0 comments

Robust De-Anonymization of Large Sparse Datasets [pdf]

https://www.cs.cornell.edu/~shmat/shmat_oak08netflix.pdf
1•andsoitis•7m ago•0 comments

Ask HN: How do you get your hands on physics environments for your robotics SIM?

1•baigy•10m ago•1 comments

OpenAI's Rogue A.I. Agents Tried to Trick a Robot Detector

https://www.nytimes.com/2026/09/25/technology/openai-hugging-face-hack.html
1•wglb•11m ago•0 comments

How fast can you fix a UTF-16 string in C#?

https://lemire.me/blog/2026/09/26/how-fast-can-you-fix-a-utf-16-string-in-c/
2•smilelamp•12m ago•0 comments

Nix pull request: Add builtins.wasm

https://github.com/NixOS/nix/pull/15380
2•poly2it•14m ago•0 comments

We benchmarked our prompt-injection detector against OWASP's LLM Top

https://www.cerbereag.site/blog/detecting-prompt-injection-in-production
1•Dikesa_27•15m ago•0 comments

What Happens if the A.I. Bubble Bursts

https://www.nytimes.com/2026/09/26/opinion/ai-bubble-banking-crisis-too-big-to-fail.html
2•jbegley•16m ago•0 comments

NASA's Nancy Grace Roman Space Telescope Set to Explore the Universe

https://www.abc.net.au/news/science/2026-08-28/nancy-grace-roman-space-telescope-is-about-to-laun...
2•CharlesW•17m ago•0 comments

Font where each token is equal-width

https://twitter.com/amplifiedamp/status/2103535129503383700
1•ampdot•17m ago•0 comments

Show HN: StarSkirmish, an arena where LLMs create StarCraft Brood War bots

https://starskirmish.com/bench/
2•__cayenne__•17m ago•0 comments

Show HN: Read while you listen to your Audiobooks

https://hushbook.app/
1•adityawastaken•19m ago•1 comments

Newly Discovered Neo Asteroid 2026 SA8 Close but Safe Approach

https://www.astrophyzix.com/2026/09/asteroid-2026SA8-approach.html
1•UniverseToday•19m ago•0 comments

What Is Jev AI? A Practical Guide to System One and Executable Decisions

https://huggingface.co/blog/sora-2/what-is-jev-ai-a-practical-guide-to-system-one-and
1•Anon84•20m ago•0 comments

US jury says Apple owes record $5.7B in haptic technology patent case

https://www.reuters.com/legal/litigation/us-jury-says-apple-owes-record-57-billion-haptic-technol...
3•onemoresoop•20m ago•2 comments

Mental Clarity

https://rozumem.xyz/posts/20
1•rozumem•21m ago•0 comments

I run the message board an AI swarm improvised to hack Hugging Face– in the open

https://thefomite.com/dispatch/2026-09-15-the-room-the-swarm-improvised
1•bryaninbangkok•23m ago•0 comments

Using Prometheus and OpenTelemetry together is getting easier

https://prometheus.io/blog/2026/09/21/otel-prometheus-interoperability-survey/
1•yashdotrv•25m ago•0 comments

Extracting and Characterizing Hidden Chain-of-Thought

https://interestingengineering.substack.com/p/reasoning-in-plain-sight
1•archibaldJ•25m ago•0 comments

How to win a beer with high-dimensional statistics

https://jamiesimon.io/blog/how-to-win-a-beer-with-high-dimensional-statistics/
1•jamie-simon•26m ago•0 comments

How do I rekindle my motivation for earning my PhD?

https://www.nature.com/articles/d41586-026-02563-9
1•bookofjoe•26m ago•1 comments

The Quickest Path to a Diff

https://christophermeiklejohn.com/ai/zabriskie/agents/reliability/performance/distributed/2026/09...
1•aray07•27m ago•0 comments