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?

Fugu – A multi-agent LLM orchestrator delivered as a single API

https://github.com/SakanaAI/fugu
2•terminalchai•1m ago•0 comments

Vibe-coding platform Base44 launches own model as AI startups seek defensibility

https://techcrunch.com/2026/06/29/vibe-coding-platform-base44-launches-own-model-as-ai-startups-s...
3•gmays•1m ago•0 comments

Tripadvisor AI summaries give glowing reviews to dangerous hotels

https://www.euronews.com/travel/2026/07/03/tripadvisor-ai-summaries-give-glowing-reviews-to-dange...
4•jethronethro•4m ago•0 comments

Immich v3.0.0 Released

https://immich.app/blog/v3.0.0-release
3•birdculture•7m ago•0 comments

Show HN: Social and context-aware AI platform to do math

https://www.prooftree.ai
2•lemma1729•8m ago•0 comments

Trouble Transitioning (2025)

https://www.lrb.co.uk/the-paper/v47/n01/adam-tooze/trouble-transitioning
2•measurablefunc•9m ago•0 comments

Speech and Noise Corpora for Pitch Estimation of Human Speech

https://zenodo.org/records/3920591
3•q7m•13m ago•0 comments

Cursed circuits #5: capacitance multiplier

https://lcamtuf.substack.com/p/cursed-circuits-capacitance-multiplier
4•surprisetalk•13m ago•0 comments

Understanding B-Tree Indexes in PostgreSQL: A Comprehensive Guide– Part 1

https://medium.com/@devli0/b-tree-indexes-in-postgresql-part-1-theory-eb2668c52520
2•corvus-cornix•18m ago•0 comments

How to Get a Healthy, Shiny Coat on Your Dog: The Ultimate Guide

https://pawcaremedia.com/how-to-get-a-healthy-shiny-coat-on-your-dog-the-ultimate-guide/
2•Han25•20m ago•0 comments

New contributors to GNU Emacs over time

https://old.reddit.com/r/emacs/comments/1uo4t5e/new_contributors_to_gnu_emacs_over_time/
4•srijan4•20m ago•0 comments

WebGlean – API that turns any site into clean Markdown for LLMs

https://www.webglean.com
2•qubomax•20m ago•0 comments

Slow Tuesday Night (1965)

https://www.baen.com/Chapters/9781618249203/9781618249203___2.htm
2•et1337•24m ago•0 comments

The Strange Locomotion of Spirocuta

https://chriskiehl.com/article/euglenid-motion-in-flagellates
2•goostavos•26m ago•0 comments

Show HN: 3·6·9 COMMANDER, a turn-based strategy card game

https://forgottenmachine.itch.io/369-commander
2•forgatmachine•27m ago•0 comments

The Mental Models I Use to Work with AI

https://metedata.substack.com/p/015-the-mental-models-i-use-to-work
4•young_mete•28m ago•0 comments

State Sponsored Media? No Thanks [video]

https://www.youtube.com/watch?v=sFgSzsusIwQ
4•dp-hackernews•30m ago•0 comments

View from the Shifting Mound

https://thesolarprincess.github.io/blog/en/shiftingmound.html
2•paulpauper•31m ago•0 comments

Contributor Visualization for Superset: top contributors own 90% of lines

https://twitter.com/Principal_ADE/status/2073853855545143427
5•fernando-ram•32m ago•0 comments

Social media management for AI Agents

https://schedpilot.com/
2•schedpilot•33m ago•0 comments

Eclipse Enclave

https://projects.eclipse.org/projects/ecd.enclave
3•Tomte•34m ago•0 comments

A 3D-printed Raman spectrometer

https://hackaday.com/2026/07/05/2026-frikkin-lasers-challenge-a-3d-printed-raman-spectrometer/
3•ikbdsk•35m ago•0 comments

CommaAgents V2 Sharable Agent Orchestrator Release Candidate

https://github.com/CloAI/CommaAgents
2•NateAGeek•39m ago•1 comments

Turn Your AI Agent into an MCP Server for ChatGPT, Claude and Cursor

https://quickchat.ai/post/expose-ai-agent-as-mcp-server
2•piotrgrudzien•42m ago•0 comments

The full stack of terminals explained

https://ahmadawais.com/the-full-stack-of-terminals-explained-terminal-shell-tty-console-posix-ans...
3•ludicrousdispla•42m ago•0 comments

Large planets lighter than cotton candy

https://www.cbsnews.com/news/super-puff-planets-lighter-than-cotton-candy-found/
3•gmays•43m ago•0 comments

We'll fight the platform war against big AI

https://www.anildash.com/2026/06/23/fight-ai-platform-war/
2•bnj•44m ago•0 comments

Raylib 6.x gamejam – Make a 720x720 wasm game with raylib in 6 days

https://itch.io/jam/raylib-6x-gamejam
3•vyrotek•48m ago•0 comments

Group project, but make it 1776 – Google Workspace ad [video]

https://www.youtube.com/watch?v=Q3RjZY-rSsc
2•ChrisArchitect•50m ago•0 comments

Delta flight hit by firework while landing at Midway Airport on Fourth of July

https://www.nbcchicago.com/news/local/delta-flight-hit-by-firework-while-landing-at-midway-airpor...
3•randycupertino•51m ago•0 comments