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

Rapid Customization for RAG and Context Engineering

https://www.rapidfire.ai/blogs/grounded-ai-starts-here-the-open-framework-for-rag-and-context-eng...
1•kbigdelysh•22s ago•0 comments

Amazon Forced Engineers to Use AI Coding Tools. Then It Lost 6.3M Orders

https://medium.com/@heinancabouly/amazon-forced-engineers-to-use-ai-coding-tools-then-it-lost-6-3...
1•HeinanCA•26s ago•0 comments

Colon cancer now leading cause of cancer deaths under 50 in US

https://www.theguardian.com/us-news/2026/mar/12/colon-cancer-leading-deaths
1•stevenwoo•45s ago•0 comments

We Built Our AI Agent

https://www.mendral.com/blog/how-we-built-our-ai-agent
1•aluzzardi•1m ago•0 comments

US- and Greek-owned tankers ablaze after Iran claims 'underwater drone' strike

https://www.lloydslist.com/LL1156592/US--and-Greek-owned-tankers-ablaze-after-Iran-claims-underwa...
2•everybodyknows•1m ago•0 comments

The Road Not Taken: A World Where IPv4 Evolved

https://owl.billpg.com/ipv4x/
1•billpg•2m ago•0 comments

NEXUS.Pulse: A Binary-First Broadcast Service. 1M Entities Streamed in 11.8µs

https://telemetry.intelligentaudio.net
1•NexusCore•3m ago•1 comments

Show HN: Sigyn – OSS native macOS secrets manager to replace .env (GUI+CLI)

https://connorguy.github.io/sigyn/
1•conguy•3m ago•0 comments

Asia rolls out 4-day weeks, WFH to solve fuel crisis caused by Iran war

https://fortune.com/2026/03/11/iran-war-fuel-crisis-asia-work-from-home-closed-schools-price-caps/
2•speckx•3m ago•0 comments

Chardet dispute shows how AI will kill software licensing

https://www.theregister.com/2026/03/06/ai_kills_software_licensing/
1•DGAP•3m ago•0 comments

Show HN: jj-benchmark – Evaluating AI agents on Jujutsu version control

https://tabbyml.github.io/jj-benchmark/
1•wsxiaoys•4m ago•0 comments

agent-shell 0.47 updates

https://xenodium.com/agent-shell-0-47-1-updates
1•xenodium•4m ago•0 comments

AI Is Heroin

https://pancake.bearblog.dev/2026-03-11-ai-is-heroin/
2•speckx•5m ago•0 comments

Show HN: Open-source project management tool

https://github.com/MislavNovalic/Axelo
1•mnovalic•5m ago•0 comments

Adding internationalization to a SaaS is easier than it used to be

1•LeanVibe•8m ago•0 comments

Show HN: An Embeddable SQLite Parser

https://github.com/sqliteai/liteparser
1•marcobambini•8m ago•0 comments

Show HN: I made PythonStarter so I could launch faster with no Next.js or React

https://pythonstarter.co/
1•dan_easterman•10m ago•1 comments

Grand jury subpoena for Signal user data in the United States District Court

https://signal.org/bigbrother/district-of-columbia/
4•nobody9999•11m ago•0 comments

The Marginal Hire

https://tomtunguz.com/marginal-hire/
1•vinhnx•12m ago•0 comments

AMD and KDE improve Linux HDR/color, co-developed using Claude Code

https://www.phoronix.com/news/AMD-More-HDR-KWin-Claude-Code
1•speckx•12m ago•0 comments

Show HN: Search 7,500 MCP servers across NPM, PyPI, and the official registry

https://api.rhdxm.com/blog/crawled-7500-mcp-servers
2•c5huracan•12m ago•1 comments

Ask Maps and Immersive Navigation: New AI Features in Google Maps

https://blog.google/products-and-platforms/products/maps/ask-maps-immersive-navigation/
1•emschwartz•13m ago•0 comments

BigQuery Graph Series – Query and Visualize Your Graph

https://medium.com/google-cloud/bigquery-graph-series-2e35bb203aac
1•tanelpoder•13m ago•0 comments

Inside the cutthroat competition for the best baguette in Paris

https://www.washingtonpost.com/travel/2026/02/27/best-baguette-paris-contest/
2•bookofjoe•14m ago•1 comments

A Good Startup Idea Checklist (2016)

https://www.tillett.info/2016/01/27/a-good-idea-checklist/
1•matthieu_bl•14m ago•0 comments

Entangl – Post-quantum secure communication protocol for AI agents

https://github.com/amitb-quantum/entangl
1•xmas123•14m ago•1 comments

MCP server that audits AI agent reasoning before decisions commit

https://espiradev.org/blog/sentinel-ai-reasoning-observatory.html
1•aespira•15m ago•1 comments

OpenClaw agents always freeze. We fixed it by building ClaWatch

https://github.com/GENWAY-AI/clawatch
4•GalDayan•16m ago•4 comments

LLMs generate billing race conditions. Every one catches it when asked

https://forward.deployed.agency/blog/check-call-deduct
1•grandSpecial•16m ago•0 comments

Show HN: Riventa.Dev – AI-native DevOps that acts, not just alerts

https://www.riventa.dev/
2•christopherAs•16m ago•0 comments