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

Database Turing Award Winner Mike Stonebraker [video]

https://www.youtube.com/watch?v=YPObBOwIrHk
1•guiambros•43s ago•0 comments

SportScore MCP – free live sports data for Claude

https://github.com/Backspace-me/sportscore-mcp
1•sportscore•10m ago•0 comments

Show HN: Stenobird, podcast transcription service for your agent

https://stenobird.com
1•somewhatjustin•11m ago•0 comments

Z.ai phasing out original subscription plans

https://docs.z.ai/devpack/transition
1•reddec•12m ago•0 comments

Quantum 'Jamming' Explores the Fundamental Principles of Nature

https://www.quantamagazine.org/quantum-jamming-explores-the-truly-fundamental-principles-of-natur...
2•rolph•14m ago•0 comments

Beyond Memorization: Violating Privacy via Inference with Large Language Models [pdf]

https://proceedings.iclr.cc/paper_files/paper/2024/file/9028b8a3ca98f58e373f0c1497a17448-Paper-Co...
1•zinekeller•15m ago•0 comments

You Can't Game Your Way to a Real Education

https://www.nytimes.com/2026/04/19/opinion/schools-edtech-laptops-games-learning.html
3•paulpauper•24m ago•0 comments

My family tried to eat fewer ultra-processed foods

https://www.theguardian.com/global/2026/apr/20/ultra-processed-foods-diet-healthy-eating
4•paulpauper•24m ago•0 comments

Trade-school graduates often enter the workforce with significant debt

https://www.wsj.com/us-news/education/they-chose-careers-in-the-trades-and-still-wound-up-with-de...
1•paulpauper•25m ago•0 comments

xAI is buying cursor for $60B and the real play isnt code editors

https://webmatrices.com/post/xai-is-buying-cursor-for-60-billion-and-the-real-play-isnt-code-editors
1•bishwasbh•27m ago•0 comments

Fundamental Theorem of Calculus

https://david.alvarezrosa.com/posts/fundamental-theorem-of-calculus/
1•dalvrosa•27m ago•0 comments

OpClave- council of LLMs to get one synthesized answer

https://www.opclave.com
1•Aarush_b•29m ago•1 comments

Tempest vs. Tempest: The Making and Remaking of Atari's Iconic Video Game

https://tempest.homemade.systems
4•mwenge•35m ago•0 comments

Small regulatory RNAs show changes in schizophrenia and bipolar disorder

https://www.nature.com/articles/s41398-026-03808-x
3•PaulHoule•35m ago•0 comments

Hermes Agent – A self-improving AI agent

https://hermes-agent.nousresearch.com
1•rob•36m ago•0 comments

AI Tokens Optimization

https://tokenpinch.com
1•javiercast•38m ago•1 comments

Stalwart v0.16: A New Foundation

https://stalw.art/blog/stalwart-0-16/
1•birdculture•39m ago•0 comments

A deadly bacteria is creeping up the Atlantic Coast

https://grist.org/health/vibrio-bacteria-florida-shellfish/
3•Brajeshwar•46m ago•0 comments

Ask HN: Feedback request on new external network attack surface discovery tool

https://turbopentest.com/cloud-easm
1•integsec•47m ago•1 comments

Aegis Solis Archive: Hash manifest for cross-platform verification

https://archive.org/details/aegis-solis-archive-master-hash-manifest-v-13-final
1•aegissolis•48m ago•0 comments

How to turn off Google AI overview

https://substack.com/@grefiti/p-192810091
1•olafnub•48m ago•0 comments

The D.C. devotees of a niche arcade game (Killer Queen)

https://51st.news/where-to-play-killer-queen-arcade-game-washington-dc-midlands/
1•gnabgib•48m ago•0 comments

China backs orbital data center startup with $8.4B in credit lines

https://spacenews.com/china-backs-orbital-data-center-startup-with-8-4-billion-in-credit-lines/
2•ivewonyoung•49m ago•0 comments

Show HN: Kumbukum, open source memory infrastructure for teams

https://kumbukum.com/
1•nitai•51m ago•0 comments

Taktile's Agentic Decision Platform

https://taktile.com/
1•doener•52m ago•0 comments

OpenAI's response to the Axios developer tool compromise

https://openai.com/index/axios-developer-tool-compromise/
2•shpat•52m ago•0 comments

CubeSandbox: Tencent's sandbox for ai agents

https://github.com/tencentcloud/CubeSandbox
1•ElasticBottle•55m ago•0 comments

A Open Source Repo to Track Elected Officials Investments

https://github.com/prixe-api/politicians
1•mc587•58m ago•0 comments

Fraud and the false optimism of AI for science

https://statmodeling.stat.columbia.edu/2026/04/22/fraud-and-the-false-optimism-of-ai-for-science/
1•ivansavz•59m ago•0 comments

Hershey's Electric Railway in Cuba

https://spectrum.ieee.org/hershey-electric-railway-cuba
3•Brajeshwar•1h ago•0 comments